Jump to content
Nytro

[Delphi] Screen Capture with parameters

Recommended Posts

[Delphi] Screen Capture with parameters

Author: zoom (cred)

program ScreenShot;

uses
Windows,
Graphics,
Jpeg;

procedure ScreenToFile(FileName: string; Quality: Word; Percent: Word);
var
Bmp: TBitmap;
Jpg: TJpegImage;
begin
Bmp := TBitmap.Create;
Jpg := TJpegImage.Create;
try
Bmp.Width := GetDeviceCaps(GetDc(0), 8) * Percent div 100;
Bmp.Height := GetDeviceCaps(GetDc(0), 10) * Percent div 100;
SetStretchBltMode(Bmp.Canvas.Handle, HALFTONE);
StretchBlt(Bmp.Canvas.Handle, 0, 0, Bmp.Width, Bmp.Height, GetDc(0), 0, 0, GetDeviceCaps(GetDc(0), 8), GetDeviceCaps(GetDc(0), 10), SRCCOPY);
Jpg.Assign(Bmp);
Jpg.CompressionQuality := Quality;
Jpg.SaveToFile(FileName);
finally
Jpg.free;
Bmp.free;
end;
end;

begin
ScreenToFile('SHOT.JPG', 50, 70);
end.

Edited by Nytro
Link to comment
Share on other sites

Toata stima pentru Nytro, delphi e cel mai tare PL , nu se poate decompila in totalitate ruleaza pe maoritatea OS, e destul de dificil, mi-as dori si eu sa stiu mai multe despre el dar ceva "Easy Guide" nu am gasit sau ceva coduri surse mai simple sa le i-au de exemplu si sa le dezvolt, poate ma puteti ajuta.

Mi-as dori sa invat basicul in visual si pe urma sa fac mutatiile in vechiul borland delphi unde nici analisti av nu mai stiu cu ce se mananca...

Edited by blackrunner1911
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...