none
Set image file thumbnail

    Question

  • Hi guys

    I need to change the thumbnail of an image in windows explorer (I want windows to present image a with thumbnail b). Is there any way to change the thumbnail using c#?

    Thanks

    Yoni

    Wednesday, January 02, 2013 7:39 AM

All replies

  • What do you mean by changing the thumbnail; size or some other property? Or do you mean show image B as thumbnail of image A (and why would you want to do that)?
    Wednesday, January 02, 2013 9:23 AM
  • I mean showing image b (or it's thumbnail) as the thumbnail of image a. I need to do it because image a is very dark, but we mostly run calculations on, so it's important we don't distort it, even if it isn't visible. But we want to set a brighter version of the image as it's thumbnail, so it would still be somewhat user friendly.

    Also, we're using tiff images with libtiff. Is it possible to do it using that? (if not, using the standard image would still help).

    Regards

    Yoni

    Wednesday, January 02, 2013 9:41 AM
  • Write the image b thumbnail to image a thumbnail.  Most images don't have a thumbnail, but they may.  Explorer looks for the thumbnail first and then constructs one from the actual image if a thumbnail doesn't exist.
    Wednesday, January 02, 2013 10:16 AM
  • That's just it, how do I change the image's thumbnail? I haven't found a way to do so.
    Wednesday, January 02, 2013 10:19 AM
  • That's just it, how do I change the image's thumbnail? I haven't found a way to do so.
    You'll have to construct a new image with a's image and b's thumbnail.
    Wednesday, January 02, 2013 11:52 AM
  • How? Can you provide the code to do it?
    Wednesday, January 02, 2013 11:55 AM
  • How? Can you provide the code to do it?
    I'm not familiar with your images.  Do it as you did when you constructed image a with a thumbnail of image a, but use a thumbnail of image b.
    Wednesday, January 02, 2013 11:59 AM
  • I didn't, that's exactly what i'm asking. You can get an image's thumbnail easily enough, there's a method just for it: http://msdn.microsoft.com/en-us/library/system.drawing.image.getthumbnailimage.aspx.

    But I haven't found any way to set a thumbnail.

    Wednesday, January 02, 2013 12:05 PM
  • I didn't, that's exactly what i'm asking. You can get an image's thumbnail easily enough, there's a method just for it: http://msdn.microsoft.com/en-us/library/system.drawing.image.getthumbnailimage.aspx.

    But I haven't found any way to set a thumbnail.

    So you mean that your image's currently don't have thumbnails?  You can study the EXIF specification and do it yourself, or use a 3rd party library.
    Wednesday, January 02, 2013 1:57 PM
  • You can't change the thumbnails of the image shown in windows explorer.  Explorer ignores any thumbnail in the image and constructs its own thumbnail directly from the image.  If you're curious, switch PropertyItems 0x501B of 2 of the JPEGs in Sample Pictures.
    Wednesday, January 02, 2013 9:42 PM