You need to write a screenshot from the DC desktop to the bitmap in memory.
procedure CaptureScreenShot(acapture: TBitMap); var c: TCanvas; r: TRect; begin c:= TCanvas.Create; c.Handle:= GetWindowDC (GetDesktopWindow); try r:= Rect(0,0,screen.width,screen.height); acapture.Width:=screen.Width; acapture.Height:=screen.Height; acapture.Canvas.CopyRect(r, c, r); finally ReleaseDC(0, c.handle); c.Free; end; end;
Add Uwe to this answer so that your form is invisible and you have ....
FCapturedScreenShot:TBitmap; .... FCapturedScreenShot:=TBitmap.Create; .... AlphaBlend:=true; AlphaBlendValue:=0; CaptureScreenshot(FCapturedScreenShot); AlphaBlendValue:=False;
use the captured screenshot for everything you need, you can assign it to a bitmap in another form or save it in an array of captured screens ...
source share