Most recent wxInclude release ?
Posted: Sun Apr 21, 2013 1:06 pm
Hello. I'm managing to embed some PNG images in my project's code (I prefer a cross-platform way rather than going with resource). So, and because I would like to keep these images in a single header file, I use wxInclude ; the one downloaded following the link from http://wiki.wxwidgets.org/Embedding_PNG_Images.
Well, however, the macros and inline functions wxInclude generates seems to be wrong and don't compile (currently under Windows, wxWidgets 2.9.4 and GCC) ; call doesn't match wxImage ctor prototypes (don't remember the exact error, but something like a long integer which should be a wxString).
So, I've commented the functions and macros produced by wxInclude and written the ones advised in the wiki :
De facto, my questions are :
Is there an up-to-date wxInclude somewhere ? The one I talk here seems to be compiled on 2007.
Or, is there an easy way to produce several image declarations in a single header (.h) from bin2c or png2wx ?
Well, however, the macros and inline functions wxInclude generates seems to be wrong and don't compile (currently under Windows, wxWidgets 2.9.4 and GCC) ; call doesn't match wxImage ctor prototypes (don't remember the exact error, but something like a long integer which should be a wxString).
So, I've commented the functions and macros produced by wxInclude and written the ones advised in the wiki :
Code: Select all
#define wxGetBitmapFromMemory(name) _wxGetBitmapFromMemory(name ## _png, sizeof(name ## _png))
inline wxBitmap _wxGetBitmapFromMemory(const unsigned char *data, int length)
{
wxMemoryInputStream is(data, length);
return wxBitmap(wxImage(is, wxBITMAP_TYPE_ANY, -1), -1);
}
Is there an up-to-date wxInclude somewhere ? The one I talk here seems to be compiled on 2007.
Or, is there an easy way to produce several image declarations in a single header (.h) from bin2c or png2wx ?