unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TForm1 =
class(TForm)
Image1: TImage;
Button1: TButton;
ListBox1: TListBox;
procedure Button1Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
WindowDC : HDC;
_Canvas : TCanvas;
begin
Image1.Picture.Bitmap.Width:=Width;
Image1.Picture.Bitmap.Height:=Height;
WindowDC := GetWindowDC(
Handle);
_Canvas:=TCanvas.Create;
Try
_Canvas.Handle:=WindowDC;
BitBlt(Image1.Picture.Bitmap.Canvas.Handle,0,0,Width,Height,_Canvas.Handle,0,0,SRCCOPY);
Finally
_Canvas.Free;
ReleaseDC(
Handle,WindowDC);
end;
end;
end.