Solved

changing size of images in image list in CListCtrl

Posted on 2004-04-01
8
534 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

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

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

770 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