蔓
蔓草
Unregistered / Unconfirmed
GUEST, unregistred user!
各位看看我的代码
procedure TForm1.Timer1Timer(Sender: TObject);
var
Bitmap: TBitmap;
MyRect : TRect;
dc:hdc;
bmpcanvas:Tcanvas;
begin
Bitmap := TBitmap.Create;
myrect:=rect(0,0,100,100) ;
bitmap.width:=100;
bitmap.height:=100;
dc:=getdc(form1.Handle);
bmpcanvas:=TCanvas.Create;
bmpcanvas.Handle:=DC;
bitmap.canvas.CopyRect(Rect(0,0,100,100),bmpcanvas,myrect);
form2.show;
Form2.image1.Width:=glass1.Width ;
form2.Image1.Height:=glass1.Height;
Form2.image1.Picture.Bitmap:= bitmap;
Bitmap.Free;
timer1.enabled:=false;
end;
form1被当住,过一会在看,在form2的image1上出现的是屏幕的内容,不是
form1的画面,这是什么原因,请指教?谢谢!
procedure TForm1.Timer1Timer(Sender: TObject);
var
Bitmap: TBitmap;
MyRect : TRect;
dc:hdc;
bmpcanvas:Tcanvas;
begin
Bitmap := TBitmap.Create;
myrect:=rect(0,0,100,100) ;
bitmap.width:=100;
bitmap.height:=100;
dc:=getdc(form1.Handle);
bmpcanvas:=TCanvas.Create;
bmpcanvas.Handle:=DC;
bitmap.canvas.CopyRect(Rect(0,0,100,100),bmpcanvas,myrect);
form2.show;
Form2.image1.Width:=glass1.Width ;
form2.Image1.Height:=glass1.Height;
Form2.image1.Picture.Bitmap:= bitmap;
Bitmap.Free;
timer1.enabled:=false;
end;
form1被当住,过一会在看,在form2的image1上出现的是屏幕的内容,不是
form1的画面,这是什么原因,请指教?谢谢!