tags:

views:

90

answers:

0

I have a C++ MFC application that uses DPtoLP to calculate logical coordinates from device coordinates. Normally this works fine.

I have a screen with square pixels. It is 1280x1024. My VMware runs W2K, with a resolution set to 800x480.

In the program the MapMode is MM_LOMETRIC.

My OnDraw code:

void CMyView::OnDraw(CDC* pDC)
{
 // TESTCODE


  CRect deviceClientRect = CRect(0,0,1000,1000);
  CRect logicalClientRect = deviceClientRect;
  pDC->DPtoLP(&logicalClientRect);

  ...
}

After this, logicalClientRect.Width() == 4000, and logicalClientRect.Height() == -5000.

Not square.

In a way, I can understand this. Normally, when you would set the resolution, it would be stretched to cover the whole screen. Within VMware this does not happen, and as a result all drawing is displayed flattened.

Has anyone seen this before, and is there some sort of solution? I don't want to presume that pixels are square.

David.