|
From: Дмитрий <dm...@ya...> - 2015-06-15 10:31:07
|
Hello!
I need to get a colour out of wxPalette (I need to create a wxMask out of it later), and I can’t figure out how to translate the C++ function GetRGB into Lua. In C++, the function returns data in pointers, but wxluaref.html suggest these arguments are not used in Lua:
// %override [bool, char red, char green, char blue] wxPalette::GetRGB(int pixel) const;
// C++ Func: bool GetRGB(int pixel, unsigned char* red, unsigned char* green, unsigned char* blue) const;
bool GetRGB(int pixel) const;
Which practically means GetRGB is useless, since it just returns an error code and gives no way to get R, G, and B..?
Am I missing something? How do I create a wxMask for the palette colour with index #0?
The documentation says that in Windows I can create a wxBitmap with a palette and use wx.wxMask(bitmap, 0), but I didn’t get this to work (probably because I’m using png and not bmp?). Also, I don’t really want my code to run in Windows only.
I'm not sure if this is the right place for such questions, if not, please point me where I can ask them. Thanks.
Best regards,
Dmitry Kushnariov
|