Toolbar icons
Posted: Wed Feb 04, 2009 1:40 am
i know this subject has been discussed over and over again, with many related threads but i still can't find a suitable workflow with good results.
My wish is (you guessed it) png embedded.
I tried wxInclude, but i had error messages popping up at startup saying image can't be added to image list (or sth like that).
I then tried a function i found in this forum, which loads png from resource file. This worked partially. I couldn't use these images for the disabled state of a toolbar button.
Then i left the idea of png, and tried xpm. First bad thing is that it supports only 1 bit alpha. Anyway, at least i see the images in both enabled and disabled states.
But i still have problems. See this image for an example. Outside the box boundaries, image should be transparent. This is true, if the button is unpressed, but when it is pressed transparency is gone! It seems like windows trying to fake transparency, by applying the background color...?
Another problem now... If a check tool button is unpressed and gets disabled, then the assigned disabled state image is shown. But if the button is pressed, and then gets disabled the active image is shown (although the button is indeed disabled).
I would be really thankful if someone told me a nice way of dealing with all these issues, once and forever. It's really disappointing in 2009 to fight for some decent transparency .
p.s i use vista
My wish is (you guessed it) png embedded.
I tried wxInclude, but i had error messages popping up at startup saying image can't be added to image list (or sth like that).
I then tried a function i found in this forum, which loads png from resource file. This worked partially. I couldn't use these images for the disabled state of a toolbar button.
Then i left the idea of png, and tried xpm. First bad thing is that it supports only 1 bit alpha. Anyway, at least i see the images in both enabled and disabled states.
But i still have problems. See this image for an example. Outside the box boundaries, image should be transparent. This is true, if the button is unpressed, but when it is pressed transparency is gone! It seems like windows trying to fake transparency, by applying the background color...?
Code: Select all
/* XPM */
static char * select_xpm[] = {
"25 25 3 1",
" c None",
". c #45464E",
"+ c #BFBDBC",
" ",
" ",
" ",
" .... ..... .... ",
" .+++++++++++++++++. ",
" .+++++++++++++++++. ",
" .+++++++++++++++++. ",
" +++++++++++++++++ ",
" +++++++++++++++++ ",
" +++++++++++++++++ ",
" .+++++++++++++++++. ",
" .+++++++++++++++++. ",
" .+++++++++++++++++. ",
" .+++++++++++++++++. ",
" +++++++++++++++++ ",
" +++++++++++++++++ ",
" +++++++++++++++++ ",
" .+++++++++++++++++. ",
" .+++++++++++++++++. ",
" .+++++++++++++++++. ",
" .+++++++++++++++++. ",
" .... ..... .... ",
" ",
" ",
" "};
Another problem now... If a check tool button is unpressed and gets disabled, then the assigned disabled state image is shown. But if the button is pressed, and then gets disabled the active image is shown (although the button is indeed disabled).
I would be really thankful if someone told me a nice way of dealing with all these issues, once and forever. It's really disappointing in 2009 to fight for some decent transparency .
p.s i use vista