dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Why does my own thumbnail can sometimes be displayed black in Windows Explorer W7

  1. #1
    Join Date
    Mar 2016
    Location
    France
    Posts
    2

    Why does my own thumbnail can sometimes be displayed black in Windows Explorer W7

    Hello,

    i have my own image format (for medical system). I want to display thumbnails in Windows Explorer. I am on W7 x64 and try to port a DLL that worked on XP..
    I developp my DLL that exports a IThumbnailProvider::GetThumbnail, and returns a HBITMAP.
    It works quite well and the DLL is well called for cx = 1024, cx = 256, cx = 480 and cx = 96 by the system, and thumbnails are displayed in all parts of explorer.... -in all sizes of icon..
    (I save also bmp in a debug directory to be sure bitmap are well generated by DLL + a log file and it's ok).

    However, they sometimes appear totally black, and in this case, DLL in not called again (image is taken into cache?). For example, if I leave the directory, and then come back again, all well displayed thumbnails are black...

    What does Windows makes with the bitmap handle I give it?
    Is that a configuration of Windows? Which one?
    Did I missed something in code? (I follow msdn help to write it).

    Thanks for any help, I'm out of idea, and already spent two days on forums..

    CÚline

  2. #2
    Join Date
    Mar 2016
    Location
    France
    Posts
    2

    Re: Why does my own thumbnail can sometimes be displayed black in Windows Explorer W7

    Hello all,

    at least I found one of the bug.
    I realized that the problem was finally only on vertical images, that is when height is greater than width...
    And cx input in GetThumbnail is the max allowed for the two direction.
    So I have to check the disposition of my image, and if height is greater, it becomes cx, and width is prorata.

    I also compiled in release, and registered DLL again and some other problem of image well displayed that were black afterwards disappeared.. don't really know why.. but works now...

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)