On Jun 15, 2015 12:31 PM, "Дмитрий" <dm...@yandex.by> wrote:
>
> 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..?

No, what it means is that it returns four values rather than returning them
through the input pointers.

> 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 believe that wxWidgets supports palletized pngs, but I have not tried
this myself.

> I'm not sure if this is the right place for
Yes, though it may take a day for me to respond.

Regards,
    John
------------------------------------------------------------------------------
_______________________________________________
wxlua-users mailing list
wxlua-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxlua-users

Reply via email to