sorry,上面的有误,下面的通过:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
procedure FormPaint(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
myBitMap:Tbitmap;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
myBitMap := TBitMap.Create;
MyBitMap.LoadFromFile('C:/WINDOWS/Circles.bmp');
end;
procedure TForm1.FormPaint(Sender: TObject);
begin
with Canvas do begin
Brush.Bitmap := Mybitmap;
FillRect(ClipRect);
Brush.Bitmap := nil;
end;
end;
end.