Преобразовать BMP в JPEG

Советы » GIF, JPEG, MetaFile » Преобразовать BMP в JPEG

unit Unit1;

interface

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

type
TForm1 = class(TForm)
  Button1: TButton;
  Image1: TImage;
  procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

uses JPEG;

procedure TForm1.Button1Click(Sender: TObject);
var
  JPEG: TJPEGImage;
  Bitmap: TBitmap;
begin
  JPEG := TJPEGImage.Create;
  Bitmap := TBitmap.Create;
  try
    Bitmap.LoadFromFile('C:Program FilesCommon Filesalarm.bmp');
    JPEG.Assign(Bitmap);
    Image1.Picture.Assign(JPEG);
  finally
    JPEG.Free;
    Bitmap.Free;
  end;
end;

end.

Другое по теме:

Категории

Статьи

Советы

Copyright © 2022 - All Rights Reserved - www.delphirus.com