6
votes

Does anyone know how to display an image in the TFileOpenDialog preview?

I am using ImageEn to display image information and to add additional file type support to the dialog. For example... I can load image information about jp2, j2k and other files types not supported, but how to load an unsupported image type for preview using ImageEn.

I am displaying image information in the dialog that works nicely, but I can not find any information about how to load an unsupported image into the PreviewHandler anywhere. I can use ImageEnIO to get the file information as well as a bitmap of the image.

TFileOpenDialog

Does TFileOpenDialog use a preview handler to display the image or is some other way needed?

I am sorry I do not have code to show for displaying the image, but I do not know how to implement it.

Rodrigo commented on Hosting Preview Handlers in Delphi VCL Applications. that the windows explorer does not use a preview handler to preview the images... so I assume the TFileOpenDialog uses the same API as Windows Explorer, but I am not even sure of this. http://theroadtodelphi.wordpress.com/2013/05/24/hosting-preview-handlers-in-delphi-vcl-applications/

If this question is too broad to be accepted here I will delete the question.

1
would OpenPictureDialog be an option?bummi
No... I know how to do that. Need to do it with TFileOpenDialog.Bill
@RRUZ, Remy Lebeau has posted Use IShellItemImageFactory instead, as it delegates to IThumbnailProvider internally (and to IExractImage and IExtractIcon when IThumbnailProvider is not available). embarcadero.newsgroups.archived.at/public.delphi.nativeapi/… Is it better to use IShellItemImageFactory?Bill
@RRUZ, I'd say it's better to try Preview Handlers instead.OnTheFly

1 Answers

4
votes

...that the windows explorer does not use a preview handler to preview the images. When I said that i mean for the standard image formats like gif, jpeg, bmp, png and so on. For another custom formats you must implement a Preview handler, additionally you can register a thumbnail using a Thumbnail Handlers and the IThumbnailProvider interface.