M
myevin
Unregistered / Unconfirmed
GUEST, unregistred user!
为什么我下面的程序无法打印呢?请问究竟该如何调用?又如何使打印出来的
东西适合所有分辨率的打印机呢?
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Buttons, RxGIF, ExtCtrls, Printers;
type
TForm1 = class(TForm)
Image: TImage;
BitBtn1: TBitBtn;
PrintD: TPrintDialog;
procedure BitBtn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
if PrintD.Execute then
begin
Printer.begin
Doc;
Printer.Canvas.Draw(Image.Width, Image.Height, Image.Picture.Graphic);
Printer.EndDoc;
end;
end;
end.
东西适合所有分辨率的打印机呢?
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Buttons, RxGIF, ExtCtrls, Printers;
type
TForm1 = class(TForm)
Image: TImage;
BitBtn1: TBitBtn;
PrintD: TPrintDialog;
procedure BitBtn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
if PrintD.Execute then
begin
Printer.begin
Doc;
Printer.Canvas.Draw(Image.Width, Image.Height, Image.Picture.Graphic);
Printer.EndDoc;
end;
end;
end.