I have been working through the Toolbar sample that came with PBForms 1.51
and came unstuck with creating a toolbar from my own created icons.
Creating the toolbar.bmp with TBbCreate from:
It has the limitation of using 16 colors - my Icons use 24bit colors
So I used Toolbar Paint to create the bitmap image list (toolbar.bmp)
It unfortunately does not keep the transparency settings of the Icon(s) The transparent background gets replaced with white, which is not so cool looking on the toolbar.
The bitmap given with the sample has a RGB(192,192,192) background, which ends up as transparent when the Image is displayed on the toolbar button.
When I create my Icons with a RGB(192,192,192) background, the background is not displayed as transparent.
I have tried the following code:-
ImageList_AddMasked hImageList, hImage, RGB(192,192,192)
ImageList_Add hImageList, hImage, RGB(192,192,192)
I could not get it to work either, it must be because the imagelist is already built/loaded when the resource file is compiled.
and/or I inserted the code in the wrong place
and/or because the toolbar is created as a toolbar class (ToolbarWindow32) I am still in the dark when it comes to classes (or any OOP)
Where/how can I specify the transparency (mask) for my Icons?
I know it can be done without using a resource file, but I want to use the resource file.
and came unstuck with creating a toolbar from my own created icons.
Creating the toolbar.bmp with TBbCreate from:
It has the limitation of using 16 colors - my Icons use 24bit colors
So I used Toolbar Paint to create the bitmap image list (toolbar.bmp)
It unfortunately does not keep the transparency settings of the Icon(s) The transparent background gets replaced with white, which is not so cool looking on the toolbar.
The bitmap given with the sample has a RGB(192,192,192) background, which ends up as transparent when the Image is displayed on the toolbar button.
When I create my Icons with a RGB(192,192,192) background, the background is not displayed as transparent.
I have tried the following code:-
ImageList_AddMasked hImageList, hImage, RGB(192,192,192)
ImageList_Add hImageList, hImage, RGB(192,192,192)
I could not get it to work either, it must be because the imagelist is already built/loaded when the resource file is compiled.
and/or I inserted the code in the wrong place
and/or because the toolbar is created as a toolbar class (ToolbarWindow32) I am still in the dark when it comes to classes (or any OOP)
Where/how can I specify the transparency (mask) for my Icons?
I know it can be done without using a resource file, but I want to use the resource file.
Comment