如題,小弟也沒有設定啥(是不是沒設定的關係ㄚ?),以 Form 的 Canvas 畫框線與文字看起來都 Ok,但是列印時框與線都很小但字體很大,小弟猜想框線小是因為沒有與印表機的Logic Pixel 做 Mapping 的關係,但,字也應該一樣小才是ㄚ?可否請高手告知小弟?
//---------------------------------------------------------------------------
void __fastcall TMainControl::PrintMenuClick(TObject *Sender){
TPrintDialog *printSetup = new TPrintDialog(this);
TPoint PixelsPerInch, PhysPageSize, OffsetStart, PageRes;
printSetup->Options << poWarning;
printSetup->Options << poPageNums;
printSetup->MaxPage = 5;
printSetup->MinPage = 1;
printSetup->FromPage = 1;
printSetup->ToPage = 5;
printSetup->Copies = 1;
printSetup->Execute();
delete printSetup;
// 此段設定列印紙張邊界 =============================================
PixelsPerInch.y = GetDeviceCaps(Printer()->Handle, LOGPIXELSY); // Get the Verticle resolution of printer
PixelsPerInch.x = GetDeviceCaps(Printer()->Handle, LOGPIXELSX); // Get the Horizon resolution of printer
Escape(Printer()->Handle, GETPHYSPAGESIZE, 0, NULL, &PhysPageSize);
Escape(Printer()->Handle, GETPRINTINGOFFSET, 0, NULL, &OffsetStart);
PageRes.y = GetDeviceCaps(Printer()->Handle, VERTRES);
PageRes.x = GetDeviceCaps(Printer()->Handle, HORZRES);
Printer()->BeginDoc();
TSize OldViewportExt, OldWindowExt;
SetMapMode(Printer()->Canvas->Handle, MM_ANISOTROPIC);
SetViewportExtEx(Printer()->Canvas->Handle,100, 100, &OldViewportExt);
SetWindowExtEx(Printer()->Canvas->Handle, 100, 100, &OldWindowExt);
// IntersectClipRect(Printer()->Canvas->Handle, 0, 0, LIB->MapToWindow(Width, Param->Ratio), LIB->MapToWindow(Height, Param->Ratio));
GP->CommGraphMode->Print(Printer()->Canvas, 1);
Printer()->EndDoc();