locked
How to display jpg on ListView having the same effect as Win Explorer - flipping from default icon to the jpg one by one RRS feed

  • Question

  • On Win Explorer, default icons with text titles are displayed while jpg are loading. Later on, jpg replaces the default icon one by one upon finishing jpg disk read. I used a default icon to load into the LargeImageList and then begin my jpg read. But once I replace the first icon with jpg on the LargeImageList, all those default icons are gone.  Do I need to create a seperate thread to read jpg? C++ examples please. Tnx.
    • Moved by Aland Li Sunday, July 11, 2010 1:39 PM Incorrect forum (From:Windows Forms General)
    Monday, July 5, 2010 4:13 PM

Answers

  • Perhaps there is a problem with reference here. Make sure that you're not replacing a reference for all icons, or destroying the default icon after loading the first image. By destroying one, you might be destroying all.

     

    Regards,

    Fábio


    "To alcohol! The cause of and solution to all of life's problems." - Homer Simpson
    • Proposed as answer by Aland Li Sunday, July 11, 2010 1:50 PM
    • Marked as answer by Aland Li Thursday, July 15, 2010 5:01 AM
    Monday, July 5, 2010 6:55 PM
  • Hi youtopia,

    Is your application a Windows Forms application? If it is a win32 or MFC application, you need to pose in the forums below:
    http://social.msdn.microsoft.com/forums/en/vcgeneral/threads/

    From your description, it seems that you want to show  a list of images in a ListView. The first image in LargeImageList ought to be the default icon and others are the really images(jpg in your case). Before you load all the images, you need to set the ImageIndex to 0(default icon). When one image is loaded, you need to reset the ImageIndex of the corresponding item to another value, but not 0, since it is the default image. To explain this more clearly, the icons stored in the LargeImageList ought to be as following:
    0: default icon, 1: icon of image1, 2: icon of image2,...

    Let me know if this does not help.
    Aland Li


    Please mark the replies as answers if they help and unmark if they don't. This can be beneficial to other community members reading the thread.
    • Marked as answer by Aland Li Thursday, July 15, 2010 5:01 AM
    Sunday, July 11, 2010 1:49 PM

All replies

  • Perhaps there is a problem with reference here. Make sure that you're not replacing a reference for all icons, or destroying the default icon after loading the first image. By destroying one, you might be destroying all.

     

    Regards,

    Fábio


    "To alcohol! The cause of and solution to all of life's problems." - Homer Simpson
    • Proposed as answer by Aland Li Sunday, July 11, 2010 1:50 PM
    • Marked as answer by Aland Li Thursday, July 15, 2010 5:01 AM
    Monday, July 5, 2010 6:55 PM
  • Hi youtopia,

    Is your application a Windows Forms application? If it is a win32 or MFC application, you need to pose in the forums below:
    http://social.msdn.microsoft.com/forums/en/vcgeneral/threads/

    From your description, it seems that you want to show  a list of images in a ListView. The first image in LargeImageList ought to be the default icon and others are the really images(jpg in your case). Before you load all the images, you need to set the ImageIndex to 0(default icon). When one image is loaded, you need to reset the ImageIndex of the corresponding item to another value, but not 0, since it is the default image. To explain this more clearly, the icons stored in the LargeImageList ought to be as following:
    0: default icon, 1: icon of image1, 2: icon of image2,...

    Let me know if this does not help.
    Aland Li


    Please mark the replies as answers if they help and unmark if they don't. This can be beneficial to other community members reading the thread.
    • Marked as answer by Aland Li Thursday, July 15, 2010 5:01 AM
    Sunday, July 11, 2010 1:49 PM
  • Thanks. This works. To flip those images one by one, do I need anther thread to do it?
    Saturday, July 31, 2010 5:56 PM
  • Hi youtopia,

    You need to create a new thread, since this thread is very old and there might be few people who have chances to see it.

    Regards,
    Aland Li


    Please mark the replies as answers if they help and unmark if they don't. This can be beneficial to other community members reading the thread.
    Monday, August 2, 2010 6:44 AM