花
花无泪
Unregistered / Unconfirmed
GUEST, unregistred user!
在设置为普通纸的时候和设置为照片纸打印的大小不一样?为什么?付原代码!
procedure TForm1.PrintImg;
var
ScaleX, ScaleY: Integer;
R: TRect;
begin
if printdialog1.Execute then
begin
Printer.BeginDoc;
with Printer do
try
ScaleX := GetDeviceCaps(Handle, logPixelsX) div
PixelsPerInch;
ScaleY := GetDeviceCaps(Handle, logPixelsY) div
PixelsPerInch;
//temp := GetDeviceCaps(Handle, logPixelsX);
R := Rect(0, 0, Image2.Picture.Width * ScaleX,
Image2.Picture.Height * ScaleY);
Canvas.StretchDraw(R, Image2.Picture.Bitmap);
finally
EndDoc;
end;
end;
end;
procedure TForm1.PrintImg;
var
ScaleX, ScaleY: Integer;
R: TRect;
begin
if printdialog1.Execute then
begin
Printer.BeginDoc;
with Printer do
try
ScaleX := GetDeviceCaps(Handle, logPixelsX) div
PixelsPerInch;
ScaleY := GetDeviceCaps(Handle, logPixelsY) div
PixelsPerInch;
//temp := GetDeviceCaps(Handle, logPixelsX);
R := Rect(0, 0, Image2.Picture.Width * ScaleX,
Image2.Picture.Height * ScaleY);
Canvas.StretchDraw(R, Image2.Picture.Bitmap);
finally
EndDoc;
end;
end;
end;