Click here to Skip to main content
15,898,134 members
Articles / Desktop Programming / MFC
Article

Using thumbnail images in a list control

Rate me:
Please Sign up or sign in to vote.
4.23/5 (25 votes)
21 Jul 2006 285.4K   4.7K   102   69
How to use thumbnail images in a list control
  • Download demo project - 19.6 Kb

    Sample Image - Thumbnail.jpg

    Introduction

    The purpose of this article is to show you how to display thumbnail images in a list control.

    The demo project is very straightforward:

    It goes through a directory that the user specified to search for all the bitmap files, and stores their names in a dynamic vector, “m_VectorImageNames”. On clicking the “Load” button, It draws the thumbnails of the bitmaps in the list control by calling the function “DrawThumbnails ()”. It then draws the selected thumbnail image to fit into the image display area.

    Acknowledgements

  • License

    This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

    A list of licenses authors might use can be found here


    Written By
    Web Developer
    United States United States
    This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

    Comments and Discussions

     
    GeneralImages with different height Pin
    Jerkan11-Sep-01 22:14
    Jerkan11-Sep-01 22:14 
    GeneralRe: Images with different height Pin
    12-Sep-01 16:47
    suss12-Sep-01 16:47 
    GeneralRe: Images with different height Pin
    12-Sep-01 19:59
    suss12-Sep-01 19:59 
    GeneralRe: Images with different height Pin
    Anonymous12-Jun-03 22:51
    Anonymous12-Jun-03 22:51 
    GeneralRe: Images with different height Pin
    yren28-Aug-03 14:58
    yren28-Aug-03 14:58 
    GeneralRe: Images with different height Pin
    Anthony_Yio28-Aug-03 0:41
    Anthony_Yio28-Aug-03 0:41 
    GeneralImage Files Pin
    Ed Dixon10-Feb-01 4:26
    Ed Dixon10-Feb-01 4:26 
    GeneralRe: Image Files Pin
    10-Feb-01 9:19
    suss10-Feb-01 9:19 
    The demo prgram can only read bitmap files. It is only for the demo. purpose and not a real world image reader. If you want to read JPEG images, you have to use JPEG library in the code to decode the images.

    The demo program does have a bug. If it cannot find any bitmap images, it should handle the situation gracefully instead of crashing. I have fixed the bug and see if I can update the project online. Thanks!

    Yi

    General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

    Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.