1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| case IDD_IMPRIMFMT:
memset(&pd,0,sizeof(PRINTDLG));
pd.lStructSize = sizeof(pd);
pd.hwndOwner = hwnd;
pd.Flags = PD_RETURNDC | PD_PRINTSETUP;
if(PrintDlg(&pd)) {
hpDash = CreatePen(PS_DASH, 0, RGB(0,0,0));
hpOld = SelectObject(pd.hDC,hpDash);
di.cbSize = sizeof(DOCINFO);
di.lpszDocName = "LabelFmt";
di.lpszOutput = NULL;
if(StartDoc(pd.hDC,&di) > 0) {
x = Disk.left/10;
y = Disk.top/10;
bmp.left = ((x * GetDeviceCaps(pd.hDC,HORZRES)) / (GetDeviceCaps(pd.hDC,HORZSIZE) * 10));
bmp.top = (int)((y * GetDeviceCaps(pd.hDC,VERTRES)) / (GetDeviceCaps(pd.hDC,VERTSIZE) * 10));
bmp.right = bmp.left + (((Disk.diam_ext/10) * GetDeviceCaps(pd.hDC,HORZRES)) / (GetDeviceCaps(pd.hDC,HORZSIZE) * 10));
bmp.bottom = bmp.top + (((Disk.diam_ext/10) * GetDeviceCaps(pd.hDC,VERTRES)) / (GetDeviceCaps(pd.hDC,VERTSIZE) * 10));
Ellipse (pd.hDC, bmp.left, bmp.top, bmp.right, bmp.bottom);
EndDoc(pd.hDC);
}
SelectObject(pd.hDC,hpOld);
DeleteObject(hpDash);
}
return 0; |
Partager