Solved

changing size of images in image list in CListCtrl

Posted on 2004-04-01
8
568 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
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!

 

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

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

705 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