Advertisement
Gov_777

screen

Feb 6th, 2016
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 0.86 KB | None | 0 0
  1. unit Unit1;
  2.  
  3. interface
  4.  
  5. uses
  6.   Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  7.   Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.Clipbrd, Vcl.Imaging.jpeg, Vcl.ExtCtrls;
  8.  
  9. type
  10.   TForm1 = class(TForm)
  11.     Image1: TImage;
  12.     procedure FormActivate(Sender: TObject);
  13.   private
  14.     { Private declarations }
  15.   public
  16.     { Public declarations }
  17.   end;
  18.  
  19. var
  20.   Form1: TForm1;
  21.  
  22. implementation
  23.  
  24. {$R *.dfm}
  25.  
  26. procedure TForm1.FormActivate(Sender: TObject);
  27. var jpg:tjpegimage;
  28. begin
  29. if Clipboard.HasFormat(CF_BITMAP) then begin Image1.Picture.Bitmap.Assign(Clipboard);
  30. jpg:=tjpegimage.create;
  31. jpg.assign(image1.picture.graphic);
  32. jpg.compressionquality:=65;
  33. jpg.compress;
  34. jpg.savetofile('d:\1.jpg');
  35. jpg.free;
  36. Close;
  37. end else begin ShowMessage('В буфере нет графики!');
  38. Close;
  39. end;
  40. end;
  41. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement