资 源 简 介
Delphi 打印图形,把图片打印出来,通过这个例子,你可以学习到:
strect:Trect;//定义打印输出矩形框的大小
temhi,temwd:integer;
begin
if DIGPrint.execute then
begin
temhi:=imgpic.picture.height;
temwd:=imgpic.picture.width;
while (temhi = printer.pageheight div 2)and
//将图形放大到打印页面的1/2大小
(temwd = printer.pagewidth div 2) do
begin
temhi:=temhi+temhi;
temwd:=temwd+temwd;
end;
with strect do //定义图形在页面上的中心位置输出
begin
left := (printer.pagewidth -temwd) div 2;
top := (printer.pageheight-temhi) div 2;
right := left+temwd;
bottom := top+temhi;
end;
with printer do
begin
begindoc;
canvas.stretchdraw(strect,imgpic.picture.graphic);
enddoc;
end;
end;