学
学习DELPHI
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.FormCreate(Sender: TObject);
var
dc:hdc;
bm:Tbitmap;
bc:Tcanvas;
begin
dc:=GetDC(panel1.handle);
bc:=Tcanvas.Create;
bm:=Tbitmap.Create;
bm.LoadFromFile('c:/a.bmp');
bc.Handle:=dc;
bc.Brush.Bitmap:=bm;
bc.FillRect(panel1.ClientRect);
bc.Free;
bm.Free;
releasedc(panel1.Handle,dc);
end;
var
dc:hdc;
bm:Tbitmap;
bc:Tcanvas;
begin
dc:=GetDC(panel1.handle);
bc:=Tcanvas.Create;
bm:=Tbitmap.Create;
bm.LoadFromFile('c:/a.bmp');
bc.Handle:=dc;
bc.Brush.Bitmap:=bm;
bc.FillRect(panel1.ClientRect);
bc.Free;
bm.Free;
releasedc(panel1.Handle,dc);
end;