Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unit Unit1;
- interface
- uses
- Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
- Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.Clipbrd, Vcl.Imaging.jpeg, Vcl.ExtCtrls;
- type
- TForm1 = class(TForm)
- Image1: TImage;
- procedure FormActivate(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- Form1: TForm1;
- implementation
- {$R *.dfm}
- procedure TForm1.FormActivate(Sender: TObject);
- var jpg:tjpegimage;
- begin
- if Clipboard.HasFormat(CF_BITMAP) then begin Image1.Picture.Bitmap.Assign(Clipboard);
- jpg:=tjpegimage.create;
- jpg.assign(image1.picture.graphic);
- jpg.compressionquality:=65;
- jpg.compress;
- jpg.savetofile('d:\1.jpg');
- jpg.free;
- Close;
- end else begin ShowMessage('В буфере нет графики!');
- Close;
- end;
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement