|
-
Jun 15th, 2013, 02:23 AM
#1
Explorer style fallback thumbnails
Let's start off by establishing I'm terrible at graphics in VB. I have zero experience with manipulating images; nothing.
My program includes a file browser with thumbnail view. If it's not an image file, it defaults to the icon associated with that file type. But some file types don't have high-resolution icons associated with them, so Explorer displays the 32x32 icon in a frame. That's what I want to do (only for all non-image file types, because getting those higher-res icons is a monumental task I haven't yet implemented). Here's a picture to clarify:

How do I take the 32x32 default icon, which I have a handle to from ImageList_GetIcon, and add a border like that for the difference between 32x32 and an arbitrary (but limited to 512x512 in my program) size? I don't even know where to begin. Right now the ImageList just gives me a scaled version, which looks terrible:

To clarify, my program is not drawing the thumbnails itself. It adds either an hIcon from a GetAssociatedIcon function, or an hBitmap from IExtractImage. So I would need to modify from that before putting it in the final image list.
-
Jun 15th, 2013, 03:47 AM
#2
Re: Explorer style fallback thumbnails
Though not a direct solution to your problem, you may, however, find ShellBrowserControls interesting. See the screenshots.
On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)
-
Jun 15th, 2013, 01:19 PM
#3
Re: Explorer style fallback thumbnails
Thanks but I've already implemented nearly all that using typelibs for IShellFolder2 et al... I need tight integration with the shell so I can do things like append the ShellContextMenu; the only thing I still need is those framed icons and eventually the higher res icons (you have to locate the source file for the association and read the resource file. I've got that far, but I have to then convert it into something I can put into an API imagelist).
Is the source code for that control available anywhere? It's written in C++ but maybe I could see the technique and translate it.
Nearly done;
-
Jun 15th, 2013, 01:57 PM
#4
Re: Explorer style fallback thumbnails
 Originally Posted by fafalone
Is the source code for that control available anywhere? It's written in C++ but maybe I could see the technique and translate it.
I'm afraid it's not open-source. 
BTW, have you already tried using the SHIL_JUMBO constant with the SHGetImageList function?
On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)
-
Jun 15th, 2013, 08:07 PM
#5
Re: Explorer style fallback thumbnails
It doesn't seem to be working. Although I haven't tried it in a compiled EXE yet and it's Vista+ only, so might not work in the IDE set for XP/SP3 compatibility. Will get back to you.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|