Solved

changing size of images in image list in CListCtrl

Posted on 2004-04-01
8
511 Views
Last Modified: 2013-11-20
Hi there,

I have a CListCtrl which is using an image list to diplay icons with captions.  It works fine.  But when I change my screen resolution, the images stay the same dimensions in pixels, which means they get proportionally bigger or smaller to everything else.  How can I make the images scale up and down in size as well?

Thank you.
0
Comment
Question by:wilsonian
  • 4
  • 4
8 Comments
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 10738987
Have a differrent image list for each resolution and use the appropriate one for the users resolution.
0
 

Author Comment

by:wilsonian
ID: 10739531
Sorry, I'm not sure I explained properly, my problem is that the images always come out as being the size they are in their .gif files, if I change the size of the images in the list parts of them just get clipped.
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 10739710
Do you mean you want the row height to increase/decrease in the list control?
0
 

Author Comment

by:wilsonian
ID: 10745367
My list control resizes so that it always takes up the same proportion of the screen.  So do the row height and column width of it. (I mean they change in terms of pixels but stay constant to the eye).  

However, the scale of the objects in the image list does not change.  I have files eg sym1.gif which are 32 by 29 pixels.  When I put them in the image list  they act as though they are still 32 by 29 but if I specify a size for the images that is smaller in pixels (as I want to do for low resolutions)  parts of them get clipped rather than the whole thing resizing.  This happens when they get put in the image list and is not affected by the amount of room they have in the list control.
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 44

Accepted Solution

by:
AndyAinscow earned 125 total points
ID: 10746729
One way would be an owner draw list control (there is an MFC example showing that, I forget what it is called but it is demonstrating how to highlight a complete row - not just first column).
I don't know offhand if there is a specific function to correct what is happening with you.  (I asssume your smaller size is using smaller images eg 25x22 or whatever it resizes down to).
0
 

Author Comment

by:wilsonian
ID: 10754728
*sigh* I was really hoping to save myself the trouble of using an owner draw list control.  I can't find any examples of how to make an owner draw list control look like it's in icon view.  Do you know of any?
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 10755206
There is the MFC example that comes with VC.  It is called ROWLIST.  It may well be useful.
0
 

Author Comment

by:wilsonian
ID: 10755550
Yeah, I've done owner draw list controls before, they just aren't well suited to icon view lists.  However, custom draw seems to have some promise, I'm in the process of checking it out.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now