How to create an preview-picture? Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
fox287
Earned a small fee
Earned a small fee
Posts: 15
Joined: Sat Aug 01, 2009 12:12 pm

How to create an preview-picture?

Post by fox287 »

My application uses wxwidgets to create, edit and visualize finite element meshes.
For saving it uses a proprietary file format.
It would be nice (at least under windows) to see a preview of the mesh in the operating system explorer by only selecting a file (as it is done with several picture or office file formats).
What I mean is the picture that appears on the left side of the explorer window, not the normal thumbnails.


How does this preview work?
Are there any hidden pictures in the folders?
orbitcowboy
I live to help wx-kind
I live to help wx-kind
Posts: 178
Joined: Mon Jul 23, 2007 9:01 am

Post by orbitcowboy »

if you have the printed version of wxWidgets-Book (http://www.wxwidgets.org/about/datashee ... tsBook.pdf). There is a programm called wxThumbnailCtrl. It shows preview images.

I hope it helps?

Best regards

Orbitcowboy
OS: Ubuntu 9.04 (32/64-Bit), Debian Lenny (32-Bit)
Compiler: gcc/g++-4.3.3 , gcc/g++-4.4.0
wxWidgets: 2.8.10,2.9.0
fox287
Earned a small fee
Earned a small fee
Posts: 15
Joined: Sat Aug 01, 2009 12:12 pm

Post by fox287 »

Thank you for your answer, but what I mean is the preview picture that appears on the left side of the explorer-window by selecting a file, not the thrumbnails.
You can see it on the attached picture.

I`d like to have a preview like this with my own program files (which have their own format).
Attachments
pic.jpg
upCASE
Moderator
Moderator
Posts: 3176
Joined: Mon Aug 30, 2004 6:55 am
Location: Germany, Cologne

Post by upCASE »

Hi!

Well, basically this "preview" is a larger thumbnail.
Simply load the image and scale it for display.
OS: OpenSuSE, Ubuntu, Win XP Pro
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4

"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda
User avatar
doublemax
Moderator
Moderator
Posts: 19160
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Post by doublemax »

i think the OP wants to know how to integrate it into Windows Explorer so that it displays a preview for a custom file type.

As usual with Windows APIs, which tend to be more complicated than necessary, this is not a trivial task ;)

This might get you started:
http://msdn.microsoft.com/en-us/library ... 85%29.aspx
http://www.codeproject.com/KB/shell/thumbextract.aspx
Use the source, Luke!
fox287
Earned a small fee
Earned a small fee
Posts: 15
Joined: Sat Aug 01, 2009 12:12 pm

Post by fox287 »

Yes doublemax, you are right - thats what I want to know.
Thank you very much for your links.
Post Reply