【发布时间】:2014-07-31 01:07:15
【问题描述】:
我正在使用第三方库来绘制图表。该库需要 HDC (GDI)。但我的应用程序正在使用 GDI+。
Q1:这样做安全吗?
void f(Gdiplus::Graphics& graphics)
{
HDC dc = graphics.GetHDC();
// Call 3rd party lib functions using dc
// ...
graphics.ReleaseHDC(dc);
}
Q2:lib 的一些函数需要一个边界 RECT 结构 (WinAPI)。如果我使用毫米作为页面单位,如何计算该矩形的坐标?
graphics.SetPageUnit(UnitMillimeter);
【问题讨论】: