Toolbar Icons

Started by David Martin, February 27, 2005, 12:01:58 PM

Previous topic - Next topic

David Martin

I am trying to build a MDI application with a 7 button toolbar using 48 x 48 XP icons.

Here is an example of what one icon looks like:



Here is what it looks like in FF:



What's up with that?

TechSupport

What is te color depth of the icons? I am not near my source code right now but if I remember correctly, FireFly uses LoadImage which may not handle icons with a great number of colors.

BTW, are you developing your program in FireFly and Phoenix? ;)  I saw a similar post on Dominic's site. If you are, then what can I do to help win the race?  :D

David Martin

Quote from: TechSupportWhat is te color depth of the icons? I am not near my source code right now but if I remember correctly, FireFly uses LoadImage which may not handle icons with a great number of colors.
Yeah, they are 32 bit.

Quote from: TechSupportBTW, are you developing your program in FireFly and Phoenix? ;)  I saw a similar post on Dominic's site.
Tried both those so far, without the results I want, so now I am on PwrDev.  Look for my posts in Edwin's Forum next  :shock:

Quote from: TechSupportIf you are, then what can I do to help win the race?  :D
A kick a$$ tab implementation ( I am going to have a lot of 2 or 3 page tab forms ), form templates, control templates, imagelists all come to mind.

Phoenix has a lot of real neat features but I seem to bump into problems every time I have tried to use it for a complete program.  I have managed to finish deliverable programs with both FF and PwrDev, although nothing that complicated.

That is what I am starting to work on now ... my main "bread and butter" application.  It has been out since 1986 and in FoxPro since 1990.  I am trying to start with a nice Main Menu that can have modules added to it easily.

Owning all three PwrDev, FF and Phoenix gives me a lot, probaly to many, choices.  But it also gives me source code in three different formats that I can look through using Lynx ... this has helped me tremendously in getting a better grasp on how things work in the "Wonderfull World of Windows".

TechSupport

Hi David,

If you look at the code that is generated for the Toolbar you will see that the Image Lists that are created use the %ILC_COLOR flag. Maybe you can run a quick test for me? Manually change those equates from %ILC_COLOR to %ILC_COLOR32 and re-compile your project's main .BAS file (from JellyFish or the PB Editor, etc...).


from:
   FF_ImageListNormal = ImageList_Create(24, 24, %ILC_COLOR Or %ILC_MASK, 5, 1)

to:
   FF_ImageListNormal = ImageList_Create(24, 24, %ILC_COLOR32 Or %ILC_MASK, 5, 1)



Does the color look any better?

David Martin

I tried this before.  But, whenever I choose Ctrl + F5 Compile Exe .. ( Hey, shouldn't there be three periods there instead of two?) FF replaces the Project1_IVYMAINMENU_FORM.inc file with a newly built one ... wiping out the changes.

David Martin

Here is something else for yah.  Whenever I reload that project only the first four icons show on the toolbar.

If I bring up the Toolbar Editor and click on Ok it shows all seven.

The compiled exe always correctly has all seven.

Roger Garstang

You have to compile it outside of FireFly and compile the Main .bas file.  It may still give you errors though as you'd be using new equates that inclean may not have in the generated include file, so you'd have to look them up.  Your image also looks like a size problem...like it is loading your 48x48 and showing them as 32x32.

TechSupport

Quote from: Roger GarstangYou have to compile it outside of FireFly and compile the Main .bas file.  It may still give you errors though as you'd be using new equates that inclean may not have in the generated include file, so you'd have to look them up.  Your image also looks like a size problem...like it is loading your 48x48 and showing them as 32x32.

Roger - right you are.

David:

- make sure that you select the 32x32 size in the "Toolbar Styles" dialog.

- Ensure that you have the "Use IncLean" Environment Option unchecked.

- Compile from within FireFly.

- Exit FireFly

- Find the generated source code for the Form. There should be a section in the code where the toolbar is created. That code contains the creation of 3 image lists. For each image list, change the %ILC_COLOR to %ILC_COLOR32. Save the file.

- Remain outside of FireFly and load the main generated source file (.bas) into a code editor (JellyFish, PBEditor, etc).

- Compile and run from.

How are your results now???? If that corrects the problem then I may have to add additional options in the toolbar settings for %ILC_COLOR, %ILC_COLOR32, etc.

Roger Garstang

Actually he said he has 48x48, so he'd need that selection in styles.  Unless they are really 32x32 then he'd need that setting.  Best bet would be to open them up in an icon editor and confirm the sizes.  Also, that there aren't any other types/sizes of icons in there that may be loading.

Paul,

While we are on sizes, the imagelist I assume sets up whatever size the style is, but when images are added you need a handle and I assume this is got from LoadImage.  I haven't looked at generated code for toolbars yet, but does the size in LoadImage match the size in the imagelist and the style of the toolbar?

TechSupport

Quote from: Roger GarstangI haven't looked at generated code for toolbars yet, but does the size in LoadImage match the size in the imagelist and the style of the toolbar?

Yes it does - they both match.

David Martin

Quote from: TechSupportchange the %ILC_COLOR to %ILC_COLOR32
Paul,

This took care of the problem.  I checked it with 256 color and 32 bit XP icons and they all looked great in the compiled exe.

Roger Garstang

Hmm, sounds like a new option is needed for specifying 4,8,16,24,32 bit imagelists...or maybe just specify 32 if memory isn't an issue and it doesn't effect other bit icons loaded.

ILC_COLOR alone either is 4bit or DDB.

TechSupport

Quote from: Roger GarstangHmm, sounds like a new option is needed for specifying 4,8,16,24,32 bit imagelists...

These options have now been added to the "Toolbar Styles" popup window. This new feature will be in the next FireFly update.

David Martin

Great, does that mean that they will display correctly in the designer also?

TechSupport

Quote from: David MartinGreat, does that mean that they will display correctly in the designer also?

Yes, definately.