ScreenShot

{$R *.dfm}
function GetDesktopScreenShot:TBitmap;
var
Desktop:HDC;
begin
Result:= TBitmap.Create;
Desktop:= GetDC(0);
try
try
Result.PixelFormat := pf32bit;
Result.Width := Screen.Width;
Result.Height := Screen.Height;
BitBlt(Result.Canvas.Handle,0,0, Result.Width, Result.Height, Desktop,0,0,SRCCOPY);
Result.Modified := True;
finally
ReleaseDC(0,Desktop);
end;
except
Result.Free;
Result:=nil;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Image1.Picture.Bitmap := GetDesktopScreenShot;
end;

end.

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: