Solved

changing size of images in image list in CListCtrl

Posted on 2004-04-01
8
561 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
mixString challenge 36 137
maven archtype selection in eclipse 1 59
haveThree challenge 22 127
Annoying "thing" blocks my view 4 145
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.

734 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