Y
yifeibbs
Unregistered / Unconfirmed
GUEST, unregistred user!
为什么窗口显示后没有图像?????
是不是时机不对?
可不可以在其它事件中使用该代码?
procedure TMainFrm.ApplicationEvents1Activate(Sender: TObject);
var
DC:HDC;
screenCanvas:Tcanvas;
begin
DC:=getdc(0);
ScreenCanvas:=Tcanvas.Create;
ScreenCanvas.Handle:=DC;
img.Picture.Bitmap.Canvas.CopyRect(Rect(0,0,screen.Width,screen.Height),screencanvas,Rect(0,0,screen.Width,screen.Height));
//img:Timage;img.align=alclient;
Screencanvas.Free;
releaseDC(0,DC);
end;
是不是时机不对?
可不可以在其它事件中使用该代码?
procedure TMainFrm.ApplicationEvents1Activate(Sender: TObject);
var
DC:HDC;
screenCanvas:Tcanvas;
begin
DC:=getdc(0);
ScreenCanvas:=Tcanvas.Create;
ScreenCanvas.Handle:=DC;
img.Picture.Bitmap.Canvas.CopyRect(Rect(0,0,screen.Width,screen.Height),screencanvas,Rect(0,0,screen.Width,screen.Height));
//img:Timage;img.align=alclient;
Screencanvas.Free;
releaseDC(0,DC);
end;