ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 How to find a list of supported formats?

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Mason Wheeler Posted - Jan 28 2014 : 18:25:16
Is there any way to programatically find a list of all file formats supported by ImageEn? I'd like to be able to fill in a Open File dialog box's list of filters this way. For that, I'd need a list of all formats, with both a user-friendly name and an extension. (ie. "PNG Image, *.png")

Does ImageEn have any functionality that can be used to query for a list like this? It would need to include custom formats that have been registered, since we're using that functionality.
5   L A T E S T    R E P L I E S    (Newest First)
w2m Posted - Jan 28 2014 : 19:51:12
Well... it is not perfect but I spent quite a bit of time making a FileDialog that looks similar to the imageen dialogs with image information in labels with a image preview.

The file info stuff works very well... but I am sure it could be improved some. If you send me your email address I'll send it to you.
I am not that good at com so this was quite difficult for me. Maybe you can improve it where needed and we will both benefit.




William Miller
Adirondack Software & Graphics
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html
Mason Wheeler Posted - Jan 28 2014 : 19:21:07
Because of the COM stuff, actually. TFileOpenDialog gives access to IFileDialogCustomize, which is an OS-supported way to add custom functionality to a dialog box that is guaranteed to continue to still look right when Windows 9 comes out. (This is all part of a project to replace a bunch of custom file dialogs that were built during the XP era and look very out of place on a Win7 system.)
w2m Posted - Jan 28 2014 : 19:11:38
TFileOpenDialogs are very complicated to deal with. Lots of com and somewhat unusual programming. Why not use TOpen/SavePicture dialogs... they are very similar with Win 7 and 8.

William Miller
Mason Wheeler Posted - Jan 28 2014 : 19:05:20
That looks very helpful, but the dialog in question is of class TFileOpenDialog, which has a FileTypes property rather than a Filter property.

Do you have anything that supports that? If not, I can probably work from what you've posted so far.
w2m Posted - Jan 28 2014 : 19:02:04
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