Solved

changing size of images in image list in CListCtrl

Posted on 2004-04-01
8
546 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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

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
 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
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…
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 shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

831 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