F
fscdc1
Unregistered / Unconfirmed
GUEST, unregistred user!
如何实现打印完bmp图片后不走纸,请给出正确的代码:附我的打印图片的代码是:
procedure Tshowprint1Form.toprint(Sender: TObject);
var x,y,i,temhi,temwd:integer;
strect:Trect;
ADevice,Adriver,APort:string;
PDevice,Pdriver,PPort:array[0..255] of char;
hDMODE:THandle;
PDMODEDevicemode;
begin
//打印
// temhi:=image1.Picture.Height ;
// temwd:=image1.Picture.width ;
while (temhi<printer.PageHeight) and (temwd<printer.pagewidth)do
begin
temhi:=temhi+temhi;
temwd:=temwd+temwd;
end;
with strectdo
begin
left:=1;
top:=1;
right:=left+temwd;
bottom:=top+temhi;
end;
with printerdo
begin
begin
doc;
canvas.stretchDraw(strect,image1.picture.graphic);
enddoc;
end;
end;
procedure Tshowprint1Form.toprint(Sender: TObject);
var x,y,i,temhi,temwd:integer;
strect:Trect;
ADevice,Adriver,APort:string;
PDevice,Pdriver,PPort:array[0..255] of char;
hDMODE:THandle;
PDMODEDevicemode;
begin
//打印
// temhi:=image1.Picture.Height ;
// temwd:=image1.Picture.width ;
while (temhi<printer.PageHeight) and (temwd<printer.pagewidth)do
begin
temhi:=temhi+temhi;
temwd:=temwd+temwd;
end;
with strectdo
begin
left:=1;
top:=1;
right:=left+temwd;
bottom:=top+temhi;
end;
with printerdo
begin
begin
doc;
canvas.stretchDraw(strect,image1.picture.graphic);
enddoc;
end;
end;