Method 1: Modify the onpreparedc function
PDC-> setmapmode (mm_anisotropic);
CSIZE SIZE = CSIZE (800, 560);
PDC-> setWindowext (size); // Setting the window size
/ / Get the number of pixels per logical inch
INT XLogpixPerinch =
PDC-> GetDeviceCaps (Logpixelsx);
Int YlogpixPerinch =
PDC-> GetDeviceCaps (Logpixelsy);
// Get the proportion of equipment coordinates and logical coordinates
Long Xext = (long) size.cx * xlogpixperinch / 96;
Long Yext = (long) size.cy * YLOGPIXPERINCH / 96;
PDC-> SetViewPortext (INT) Xext, (int) Yext);
// Set the viewport size
Method 2: Modify OnPrint function
PDC-> setmapemode (Lometric)
nsizex = getDeviceCaps (Horzsize)
nsizey = getDeviceCaps (Vertsize)
// Get physical width
nsizex = nsizex / 0.1
nsizey = nsizey / 0.1
Then you can use the PDC to draw on NSizex.