2楼 的不行。
========
我的代码如下,打印后,打印机有反应,但没有图像打印出来,软件界面image1.图像也自动没有了。
图片本身不大。
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs,printers, StdCtrls, jpeg, ExtCtrls;
type
TForm1 = class(TForm)
Image1: TImage;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
r:TRect;
begin
printer.BeginDoc;
r:=rect(0,0,300,300);
Printer.Canvas.StretchDraw(r,Image1.Picture.Bitmap);
printer.EndDoc;
end;
end.