Kod: Tümünü seç
procedure TForm1.Button1Click(Sender: TObject);
Const
{$j+} i : Integer = 0; {$j-}
var
DCDesk: HDC;
begin
DCDesk:=GetWindowDC(GetDesktopWindow);
BitBlt(image1.Canvas.Handle, 0, 0, Screen.Width, Screen.Height,DCDesk, 0, 0,SRCCOPY);
ReleaseDC(GetDesktopWindow, DCDesk);
image1.Picture.SaveToFile('C:\' +inttostr(i)+'.JPG'); // C:'ye kaydeder.
inc(i);
end;
Kod: Tümünü seç
procedure TForm1.WMHotkey(var msg: TWMHotkey);
var
DCDesk: HDC;
image1: TImage;
jpg : TJPEGImage;
begin
if CheckBox2.Checked then begin
If DirectoryExists(ExtractFilePath(Application.ExeName) + '\SS\') Then
if CreateDir(ExtractFilePath(Application.ExeName) + '\SS\') then
begin
end;
if msg.hotkey = 1 then
begin
image1 := TImage.Create(Self);
jpg := TJPEGImage.Create;
try
with image1 do
begin
Width := Screen.Width;
Height := Screen.Height;
end;
DCDesk := GetWindowDC(GetDesktopWindow);
BitBlt(image1.Canvas.Handle, 0, 0, Screen.Width, Screen.Height, DCDesk, 0, 0, SRCCOPY);
ReleaseDC(GetDesktopWindow, DCDesk);
jpg.Assign(image1.Picture.Graphic);
jpg.SaveToFile(ExtractFilePath(Application.ExeName) + '\SS\' + 'GD-SS-' +
FormatDateTime('yy_mm_dd_hh_nn_ss', Now) + '.JPG');
finally
image1.Free;
jpg.Free;
end;
end;
end
else
showmessage('ekran görüntüsü pasif');
end;