compressqual.pas

来自「Apprehend Screen Capture Component Versi」· PAS 代码 · 共 76 行

PAS
76
字号
{******************************************************************************}
{*                                                                            *}
{*                        Adirondack Software & Graphics                      *}
{*                           JPEG Compression Quality                         *}
{*                                   Delphi 5                                 *}
{*          (C) Copyright Adirondack Software & Graphics 1996-2001            *}
{*                                                                            *}
{******************************************************************************}

unit CompressQual;

interface

uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
   JPeg, StdCtrls, ExtCtrls, Spin;

type
   TQualityForm = class( TForm )
      GroupBox3: TGroupBox;
      CompressionQuality1: TSpinEdit;
      Button1: TButton;
      Button2: TButton;
      Label1: TLabel;
      Label2: TLabel;
    Panel1: TPanel;
      procedure Button2Click( Sender: TObject );
      procedure Button1Click( Sender: TObject );
      procedure FormCreate( Sender: TObject );
      procedure FormDestroy( Sender: TObject );
   private
    { Private declarations }
   public
    { Public declarations }
      Picture: TPicture;
   end;

var
   QualityForm: TQualityForm;

implementation

{$R *.DFM}

procedure TQualityForm.Button2Click( Sender: TObject );
var
   Temp: Boolean;
begin
   Temp := Picture.Graphic is TJPEGImage;
   if Temp then
      with TJPEGImage( Picture.Graphic ) do
         CompressionQuality := 100;
end;

procedure TQualityForm.Button1Click( Sender: TObject );
var
   Temp: Boolean;
begin
   Temp := Picture.Graphic is TJPEGImage;
   if Temp then
      with TJPEGImage( Picture.Graphic ) do
         CompressionQuality := CompressionQuality1.Value;
end;

procedure TQualityForm.FormCreate( Sender: TObject );
begin
   Picture := TPicture.Create;
end;

procedure TQualityForm.FormDestroy( Sender: TObject );
begin
   Picture.Free;
end;

end.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?