Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting Picture property to an ICO file

Status
Not open for further replies.

Mike Lewis

Programmer
Jan 10, 2003
17,516
Scotland

When you specify an ICO file for a command button's Picture property, it possible to specify which size of icon you want to show?

An ICO file can contain multiple images, at several different sizes. But VFP always seems to select the 32 x 32 image, regardless of the size of the command button. If the button is smaller than 32 x 32, the picture gets clipped. If it's larger, you get blank space around the picture.

This has arisen because I have just downloaded Axialis Icon Workshop, as recommended by FatSlug in thread184-1157006. This is a truly excellent program, and within a few minutes I had created a good-looking ICO file containing images ranging from 16 x 16 to 48 x 48. I was disappointed to see that only the 32 x 32 version shows up in VFP.

Any advice would be appreciated.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
Mike,
I found this link that may hint at your delima -

PictureMargin Property

Specifies the number of pixels between an image and the edge of the control. You can specify a value of 0 (default) to 65,535 for nValue. When PictureMargin is set to 0, positioning of the image is determined by the PicturePosition and Alignment properties. When PictureMargin is greater than 0, the image appears nValue number of pixels from the edge of the control and only PicturePosition affects the positioning of the image. For more information, see PicturePosition Property and Alignment Property.
 

White,

Thanks for your reply. That's useful information, but unfortunately, it it totally unrelated to my problem. The issue is not the positioning of the image, but its size.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
Hi Mike,
Not sure if this will help, but it must be a related issue. See this website for more explanation. *********************************************************
Small icons are created by specifying the Small Icon 16-color 16x16 option when creating a new icon in ImagEdit. If this option is not available when you create a new icon, add the following lines to the IMAGEDIT.INI file located in your Windows directory:

[ImagEdit.Icon]
Small Icon=16,16,16
**********************************************************
Bill
 

Thanks, Bill. But, again, that doesn't answer my question. I know how to create icons at various sizes. I just don't know how to tell VFP to use a specific size for the Picture property.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
Sounds like a request to the developers for a new feature.

There isn't even a parameter for LOADPICTURE(), if one was to try a use different icon sizes somewhere other than a button control.


-Dave Summers-
[cheers]
Even more Fox stuff at:
 
Hi Mike,

if you insist on having – let's say – 48 x 48 version of ICO file on your button or elsewhere, leave only this one definition in ico file. It forces VFP to display what you want
Sorry for such a poor advise.

Tom.
 

Tom,

I'm not sure that's right. In my tests, I have tried ICOs with multiple images, and with individual images of various sizes. In each case, VFP appears always to display the image at 32 x 32. If that size isn't present in the file, VFP rescales the actual image to 32 x 32 -- regardless of the size of the button.

If I'm wrong about this, I'd appreciate knowing about it, but that's my observations up to now.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
Mike,
Bad news – you are right. 48 x 48 icon will be displayed if no other icons exist in ico file, but rescaled to 32 x 32.
It correspondents to return value of SYSMENTRIC(16).
To my surprise it does not correspondent to value of HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics\Shell Icon Size. In other words, if one changes the size of the large icons in Windows, icon on VFP button remains the same: 32 by 32 pixels. VFP goes its way as usually and I don't believe now, that there is a way to change it.
Happy New Year for you and all good people here.
Tom.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top