L
LEYT8
Unregistered / Unconfirmed
GUEST, unregistred user!
各位大虾:
有一事不明,请指教,不知下面的程序哪里出了问题,无法显示图像。
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
Bitmap: TBitmap;
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.FormCreate(Sender: TObject);
var
x, y: Integer;
MyRect, MyOther: TRect;
begin
try
x:=0;y:=0;
MyRect := Rect(0,0,100,100);
MyOther := Rect(0,0,100, 100);
Bitmap := TBitmap.Create;
Bitmap.LoadFromFile('F:/scr2/mid/2.bmp');
Form1.Canvas.CopyRect(MyOther,Bitmap.Canvas,MyRect);
finally
Bitmap.Free;
end;
end;
end.
有一事不明,请指教,不知下面的程序哪里出了问题,无法显示图像。
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
Bitmap: TBitmap;
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.FormCreate(Sender: TObject);
var
x, y: Integer;
MyRect, MyOther: TRect;
begin
try
x:=0;y:=0;
MyRect := Rect(0,0,100,100);
MyOther := Rect(0,0,100, 100);
Bitmap := TBitmap.Create;
Bitmap.LoadFromFile('F:/scr2/mid/2.bmp');
Form1.Canvas.CopyRect(MyOther,Bitmap.Canvas,MyRect);
finally
Bitmap.Free;
end;
end;
end.