关于图形直接打印,请问如何能自动调整图形大小,适应A4纸!以下代码如何修改!(200分)

  • 主题发起人 主题发起人 wtb
  • 开始时间 开始时间
W

wtb

Unregistered / Unconfirmed
GUEST, unregistred user!
var
ScaleX, ScaleY: Integer;
R: TRect;
begin
if printdialog1.Execute then
begin
Printer.begin
Doc;
with Printerdo
try
ScaleX := GetDeviceCaps(Handle, logPixelsX) div
PixelsPerInch;
ScaleY := GetDeviceCaps(Handle, logPixelsY) div
PixelsPerInch;
//temp := GetDeviceCaps(Handle, logPixelsX);
R := Rect(0, 0, Image3.Picture.Width * ScaleX,
Image3.Picture.Height * ScaleY);
Canvas.StretchDraw(R, Image3.Picture.Bitmap);
finally
EndDoc;
end;
end;
 
var
R: TRect;
begin
if printdialog1.Execute then
begin
Printer.begin
Doc;
//开始打印
with Printerdo
R := Rect(0, 0, printer.pagewidth,
printer.pageheight);
try
Canvas.StretchDraw(R, Image3.Picture.Bitmap);
finally
EndDoc;
//停至打印
end;
end;
 
后退
顶部