uses hyieutils;
procedure TForm1.FormCreate(Sender: TObject);
begin
{Register graphic file formats }
IERegisterFormats;
{ Set the dialog filters to match TGraphic filters }
OpenPictureDialog1.Filter := GraphicFilter(TGraphic);
SavePictureDialog1.Filter := GraphicFilter(TGraphic);
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
{UnRegister graphic file formats }
IEUnRegisterFormats;
end;
procedure TForm1.SavePictureDialog1TypeChange(Sender: TObject);
{ Change the File Extension when the FileType changes. }
var
FilePath: string;
FileName: string;
FileExt: string;
begin
FilePath := SavePictureDialog1.FileName;
FileExt := ExtractFileExt(FilePath);
FileName := ExtractFileName(FilePath);
end;
You can also use:
imageenio.IEExtToFileFormat
imageenio.IEFileFormatGetInfo
imageenio.IEFileFormatGetInfo2
imageenio.GetAllSupportedFileExtensions
But I find the simplest way is to handle the dialogs as I outlined.
William Miller
Adirondack Software & Graphics
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html