M
maginnn
Unregistered / Unconfirmed
GUEST, unregistred user!
我的程序代码如下:
procedure TForm1.Button1Click(Sender: TObject);
var
pdevice,pdriver,pport:array[0..255]of char;
hdmode:thandle;
pdmodedevicemode;
begin
if openpicturedialog1.Execute then
printer.GetPrinter(pdevice,pdriver,pport,hdmode);
if hdmode=0 then
begin
printer.PrinterIndex :=printer.PrinterIndex ;
printer.GetPrinter (pdevice,pdriver,pport,hdmode);
end;
if hdmode<>0 then
begin
pdmode:=globallock(hdmode);
if pdmode<>nil then
begin
//比例 但不好使,为什么?我该怎么办?
pdmode^.dmfields:=pdmode^.dmfields or dm_scale;
pdmode^.dmscale:=200;
globalunlock(hdmode);
end;
end;
printer.begin
Doc ;//开始打印
printer.Canvas.TextOut(700,900,'delphi is best!'
printer.EndDoc;
//结束打印
end;
procedure TForm1.Button1Click(Sender: TObject);
var
pdevice,pdriver,pport:array[0..255]of char;
hdmode:thandle;
pdmodedevicemode;
begin
if openpicturedialog1.Execute then
printer.GetPrinter(pdevice,pdriver,pport,hdmode);
if hdmode=0 then
begin
printer.PrinterIndex :=printer.PrinterIndex ;
printer.GetPrinter (pdevice,pdriver,pport,hdmode);
end;
if hdmode<>0 then
begin
pdmode:=globallock(hdmode);
if pdmode<>nil then
begin
//比例 但不好使,为什么?我该怎么办?
pdmode^.dmfields:=pdmode^.dmfields or dm_scale;
pdmode^.dmscale:=200;
globalunlock(hdmode);
end;
end;
printer.begin
Doc ;//开始打印
printer.Canvas.TextOut(700,900,'delphi is best!'
printer.EndDoc;
//结束打印
end;