add ability to create wxEnhMetaFileDC based on a reference DC

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60843 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2009-05-31 19:11:15 +00:00
parent dd36b5a3e5
commit cc3445715d
4 changed files with 60 additions and 8 deletions

View File

@@ -304,10 +304,8 @@ int WXDLLEXPORT wxGetWindowId(WXHWND hWnd)
// Metafile helpers
// ----------------------------------------------------------------------------
extern void PixelToHIMETRIC(LONG *x, LONG *y)
void PixelToHIMETRIC(LONG *x, LONG *y, HDC hdcRef)
{
ScreenHDC hdcRef;
int iWidthMM = GetDeviceCaps(hdcRef, HORZSIZE),
iHeightMM = GetDeviceCaps(hdcRef, VERTSIZE),
iWidthPels = GetDeviceCaps(hdcRef, HORZRES),
@@ -319,10 +317,8 @@ extern void PixelToHIMETRIC(LONG *x, LONG *y)
*y /= iHeightPels;
}
extern void HIMETRICToPixel(LONG *x, LONG *y)
void HIMETRICToPixel(LONG *x, LONG *y, HDC hdcRef)
{
ScreenHDC hdcRef;
int iWidthMM = GetDeviceCaps(hdcRef, HORZSIZE),
iHeightMM = GetDeviceCaps(hdcRef, VERTSIZE),
iWidthPels = GetDeviceCaps(hdcRef, HORZRES),
@@ -334,6 +330,16 @@ extern void HIMETRICToPixel(LONG *x, LONG *y)
*y /= (iHeightMM * 100);
}
void HIMETRICToPixel(LONG *x, LONG *y)
{
HIMETRICToPixel(x, y, ScreenHDC());
}
void PixelToHIMETRIC(LONG *x, LONG *y)
{
PixelToHIMETRIC(x, y, ScreenHDC());
}
void wxDrawLine(HDC hdc, int x1, int y1, int x2, int y2)
{
#ifdef __WXWINCE__