procedure JPEGToBmp;
var
BMPImage : TBitmap;
JPEGImage : TJPEGImage;
begin
JPEGImage:=TJPEGImage.Create;
try
BMPImage:=TBitmap.Create;
try
JPEGImage.LoadFromFile(OpenPictureDialog1.FileName);
BMPImage.Assign(JPEGImage);
BMPImage.SaveToFile(OpenPictureDialog1.FileName);
finally
BMPImage.Free;
end;
finally
JPEGImage.Free;
end;
end;
이거 호출할려면 어떻게해요?;;
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, jpeg;
type
TForm1 = class(TForm)
Button1: TButton;
OpenDialog1: TOpenDialog;
Edit1: TEdit;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
procedure JPEGToBmp;
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.JPEGToBmp;
var
BMPImage : TBitmap;
JPEGImage : TJPEGImage;
begin
JPEGImage:=TJPEGImage.Create;
try
BMPImage:=TBitmap.Create;
try
JPEGImage.LoadFromFile(edit1.text);
BMPImage.assign(JPEGImage);
BMPImage.SaveToFile(edit1.text);
finally
BMPImage.Free;
end;
finally
JPEGImage.Free;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
if opendialog1.Execute then
if (opendialog1.FileName <> '') then begin
edit1.text:=opendialog1.FileName;
JPEGToBmp;
end;
end;
end.