B
biggj
Unregistered / Unconfirmed
GUEST, unregistred user!
如果在Image中调出了图片,怎么打都OK,
var
ScaleX, ScaleY: Real;
R: TRect;
begin
with Printer do
try
BeginDoc;
ScaleX := GetDeviceCaps(Printer.Handle, LOGPIXELSX) div PixelsPerInch;
ScaleY := GetDeviceCaps(Printer.Handle, LOGPIXELSY) div PixelsPerInch;
R := Rect(0, 0, Round(Image2.Picture.Width * ScaleX),Round(Image2.Picture.Height * ScaleY));
Canvas.StretchDraw(R, Image2.Picture.Graphic);
finally
EndDoc;
end;
end;
如果我先调用这个清Image,然后写文字的东西,送打印就什么也打不出来
with image2 do
begin
Canvas.FillRect(rect(0,0,200,200));
Canvas.Font.Name:='宋体';
Canvas.Font.Size:=20;
Canvas.TextOut(10,10,'设备空号清单');
end;
end;
var
ScaleX, ScaleY: Real;
R: TRect;
begin
with Printer do
try
BeginDoc;
ScaleX := GetDeviceCaps(Printer.Handle, LOGPIXELSX) div PixelsPerInch;
ScaleY := GetDeviceCaps(Printer.Handle, LOGPIXELSY) div PixelsPerInch;
R := Rect(0, 0, Round(Image2.Picture.Width * ScaleX),Round(Image2.Picture.Height * ScaleY));
Canvas.StretchDraw(R, Image2.Picture.Graphic);
finally
EndDoc;
end;
end;
如果我先调用这个清Image,然后写文字的东西,送打印就什么也打不出来
with image2 do
begin
Canvas.FillRect(rect(0,0,200,200));
Canvas.Font.Name:='宋体';
Canvas.Font.Size:=20;
Canvas.TextOut(10,10,'设备空号清单');
end;
end;