Hello guys, we are trying to package an icon set for the WebEdit plugin, however are having trouble implementing
.ico files instead of bitmap. Is it possible that the standard toolbar control simply does not support formats other than .bmp?
If not how do we implement .ico instead?
I've experienced the same problem. Therefore you can find two identical images in NppExec's sources: the .ico file for tab-control and the .bmp for tool-bar.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The toolbar struct did have support for .ico, but it was never implemented (I think thats the exact reason all plugin icons disappear when selecting other icon sets). When rewriting the toolbar I considered adding it in, but I'm afraid this'll break one thing and another, since not all plugins make use of it I think (possible with garbage data in the icon handles). Don made it so he should know best. I'm not sure if the toolbar supports .ico natively but a few function calls convert HICON to HBITMAP: http://www.codeguru.com/forum/archive/index.php/t-250652.html
The important function here is GetIconInfo (to enforce transparency, I think you have to get the color bitmap, put it in a DC, blit the transparency bitmap over it in some special way (I dont know how exactly, it has always puzzled me) making transparent section the grey transparent color and give the resulting bitmap to N++)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello guys, we are trying to package an icon set for the WebEdit plugin, however are having trouble implementing
.ico files instead of bitmap. Is it possible that the standard toolbar control simply does not support formats other than .bmp?
If not how do we implement .ico instead?
Please see these threads:
http://sourceforge.net/forum/forum.php?thread_id=1959856&forum_id=482781
http://sourceforge.net/forum/forum.php?thread_id=2169975&forum_id=482781
Thanks!
I've experienced the same problem. Therefore you can find two identical images in NppExec's sources: the .ico file for tab-control and the .bmp for tool-bar.
The toolbar struct did have support for .ico, but it was never implemented (I think thats the exact reason all plugin icons disappear when selecting other icon sets). When rewriting the toolbar I considered adding it in, but I'm afraid this'll break one thing and another, since not all plugins make use of it I think (possible with garbage data in the icon handles). Don made it so he should know best. I'm not sure if the toolbar supports .ico natively but a few function calls convert HICON to HBITMAP:
http://www.codeguru.com/forum/archive/index.php/t-250652.html
The important function here is GetIconInfo (to enforce transparency, I think you have to get the color bitmap, put it in a DC, blit the transparency bitmap over it in some special way (I dont know how exactly, it has always puzzled me) making transparent section the grey transparent color and give the resulting bitmap to N++)
I'll take a look at it.
If there're no a lot coding effort, icon format will be supported in the future versions.
Don
> possible with garbage data in the icon handles
This is easily handled by ignoring the icon handle when bitmap handle != 0 (i.e. the bitmap will have precedence if both handles are specified).