We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

changing size of images in image list in CListCtrl

wilsonian
wilsonian asked
on
Medium Priority
825 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.
Comment
Watch Question

AndyAinscowFreelance programmer / Consultant
CERTIFIED EXPERT

Commented:
Have a differrent image list for each resolution and use the appropriate one for the users resolution.

Author

Commented:
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.
AndyAinscowFreelance programmer / Consultant
CERTIFIED EXPERT

Commented:
Do you mean you want the row height to increase/decrease in the list control?

Author

Commented:
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.
Freelance programmer / Consultant
CERTIFIED EXPERT
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
*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?
AndyAinscowFreelance programmer / Consultant
CERTIFIED EXPERT

Commented:
There is the MFC example that comes with VC.  It is called ROWLIST.  It may well be useful.

Author

Commented:
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.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.