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!

Icons in VFP Form Controls Toolbar

Status
Not open for further replies.

AndrewMozley

Programmer
Oct 15, 2005
623
GB
I have been altering the icons for some form classes that I have created so that each can be identified when the toolbar is displayed. I have chosen icons from Microsoft Visual Foxpro 9\Graphics\Icons\Industry.

I find that the resultant icon in VFP is not quite the same as it was in the original icon. For example rocket.ico is originally a 16*16 icon of a spaceship, but when it is moved into the Form controls Toolbar I get a magnified version of the centre of that icon, still 16*16 as far as I can see.

Am I doing something wrong?
 
Andrew,

An ICO file contains several copies of the image. In the case of the icons in the VFP9 graphics directory, there are two images in each file: 16 x 16 and 32 x 32.

When you add an icon to a button, VFP doesn't necessarily choose the image that's best suited for the size of the button. It might take a different size image, and rescale it to fit. That's probably what's happening in your case.

The solution is to create a new ICO file, with only one image in it. Then make sure the button is large enough to hold that image.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Thanks Mike. There were indeed two icons, 16*16 and 32*32 in each .ico file.

When, however, I create a .ico file with just a single image, either 16*16 or 32*32, VFP appears to take the central portion (Rows 5-12 or Rows 9-24) and use this as the image to display; In the case where I provide a 16*16 icon, it takes that central bit and scales it up.

It is not that important! but it would be good to know if that is other people's experience.

Andrew M.
 
Andrew,

I think the behaviour you described might be specific to the built-in toolbars. But that doesn't make it any less annoying.

One thing you could try is to convert the ICO to a BMP. I've never tried to add custom images to the Forms Controls toolbar, so I don't know if that would solve the problem. But, in general, I've found that BMPs are less troublesome in VFP than ICOs.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top