MM_TWIPS behaves differently on XP in Parallels!

danielearwicker

Bit poster
Here's some MFC code:

// scale the viewport to use twips (1440 units per inch)
pDC->SetMapMode(MM_TWIPS);
pDC->SetMapMode(MM_ANISOTROPIC);
pDC->ScaleViewportExt(1, 1, -1, 1);

// draw a horizontal line 1 inch long
pDC->MoveTo(0, 1000);
pDC->LineTo(1440, 1000);

This produces very different results inside Parallels from what it does on a non-virtual XP install - the line is about 1/3rd of the usual length.

And yet GetDeviceCaps(pDC->m_hDC, LOGPIXELSX) returns the same value on my Parallels install of XP and on real XP machines.

I assume this is some quirk of the display driver? I can provide a test program if anyone is interested in fixing this!
 
Back
Top