1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33:
| procedure MakeScreenShot(const ATarget: TBitmap); var DesktopDC: HDC; begin DesktopDC := CreateDC('DISPLAY', nil, nil, nil); try ATarget.PixelFormat := pf32bit; ATarget.Width := Screen.Width; ATarget.Height := Screen.Height; with Atarget do BitBlt(Canvas.Handle, 0, 0, Width, Height, DesktopDC, 0, 0, SRCCOPY); finally DeleteDC(DesktopDC); end; end;
procedure MakeFormShot(const ATarget: TBitmap); begin ATarget.PixelFormat := pf32bit; ATarget.Width := Form1.Width; ATarget.Height := Form1.Height; with Atarget do BitBlt(Canvas.Handle, 0, 0, Width, Height, Form1.Canvas.Handle, 0, 0, SRCCOPY); end;
procedure MakeMemoshot(const ATarget: TBitmap); begin ATarget.PixelFormat := pf32bit; ATarget.Width := Form1.Memo1.Width; ATarget.Height := Form1.Memo1.Height; with Atarget do BitBlt(Canvas.Handle, 0, 0, Width, Height, Form1.Canvas.Handle, Form1.Memo1.Left, Form1.Memo1.Top, SRCCOPY); end; |