Moved metafile helpers from utilsexc.cpp to utils.cpp -- seemed more appropriate!

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10583 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2001-06-15 13:34:06 +00:00
parent e949bf13c5
commit b0c89ddf39
2 changed files with 38 additions and 37 deletions

View File

@@ -1184,6 +1184,44 @@ WXWORD WXDLLEXPORT wxGetWindowId(WXHWND hWnd)
#endif // wxUSE_GUI
#if wxUSE_GUI
// ----------------------------------------------------------------------------
// Metafile helpers
// ----------------------------------------------------------------------------
extern void PixelToHIMETRIC(LONG *x, LONG *y)
{
ScreenHDC hdcRef;
int iWidthMM = GetDeviceCaps(hdcRef, HORZSIZE),
iHeightMM = GetDeviceCaps(hdcRef, VERTSIZE),
iWidthPels = GetDeviceCaps(hdcRef, HORZRES),
iHeightPels = GetDeviceCaps(hdcRef, VERTRES);
*x *= (iWidthMM * 100);
*x /= iWidthPels;
*y *= (iHeightMM * 100);
*y /= iHeightPels;
}
extern void HIMETRICToPixel(LONG *x, LONG *y)
{
ScreenHDC hdcRef;
int iWidthMM = GetDeviceCaps(hdcRef, HORZSIZE),
iHeightMM = GetDeviceCaps(hdcRef, VERTSIZE),
iWidthPels = GetDeviceCaps(hdcRef, HORZRES),
iHeightPels = GetDeviceCaps(hdcRef, VERTRES);
*x *= iWidthPels;
*x /= (iWidthMM * 100);
*y *= iHeightPels;
*y /= (iHeightMM * 100);
}
#endif // wxUSE_GUI
#if 0
//------------------------------------------------------------------------
// wild character routines