G
-{GOD}-Casal
Unregistered / Unconfirmed
GUEST, unregistred user!
如何调整???
procedure TForm1.Print1Click(Sender: TObject);
var
strect:trect;
gao,kuan:integer;
begin
if printdialog1.Execute then
begin
gao:=image1.Picture.height;
kuan:=image1.Picture.width;
while (gao=(printer.pageheight div 2))and(kuan=(printer.pagewidth div 2))do
begin
gao:=gao+gao;
kuan:=kuan+kuan;
end;
with strectdo
begin
top:=(printer.PageHeight-gao) div 2;
left:=(printer.PageWidth-kuan) div 2;
right:=left+kuan;
bottom:=top+gao;
end;
with printerdo
begin
begin
doc;
canvas.StretchDraw(strect,image1.Picture.Graphic);
enddoc;
end;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
image1.Canvas.MoveTo(50,50);
image1.Canvas.LineTo(100,100);
image1.Canvas.LineTo(150,200);
image1.Canvas.LineTo(50,50);
end;
procedure TForm1.Print1Click(Sender: TObject);
var
strect:trect;
gao,kuan:integer;
begin
if printdialog1.Execute then
begin
gao:=image1.Picture.height;
kuan:=image1.Picture.width;
while (gao=(printer.pageheight div 2))and(kuan=(printer.pagewidth div 2))do
begin
gao:=gao+gao;
kuan:=kuan+kuan;
end;
with strectdo
begin
top:=(printer.PageHeight-gao) div 2;
left:=(printer.PageWidth-kuan) div 2;
right:=left+kuan;
bottom:=top+gao;
end;
with printerdo
begin
begin
doc;
canvas.StretchDraw(strect,image1.Picture.Graphic);
enddoc;
end;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
image1.Canvas.MoveTo(50,50);
image1.Canvas.LineTo(100,100);
image1.Canvas.LineTo(150,200);
image1.Canvas.LineTo(50,50);
end;