When reading a .png file into our application to use as a stipple brush, we get the following warning on Linux.
Same code on Windows but no warning.
Gtk - WARNING ** : Attempt to draw a drawable with depth 24 to a drawable with depth 1
Any idea what could cause this?
Also, the stipple pattern looks corrupt. Windows is fine.
Thanks.
--------------------------------------------------- Code --------------------------------------------------------------
fill_pattern_p->pWX_bitmap = new wxBitmap ;
fill_pattern_p->pWX_bitmap->LoadFile(pathname, wxBITMAP_TYPE_PNG) ;
fill_pattern_p->pWX_bitmap->SetDepth(1) ;
if( !fill_pattern_p->pWX_bitmap->IsOk() )
{
return ;
}
fill_pattern_p->pWX_bitmap->SetMask( new wxMask( *(fill_pattern_p->pWX_bitmap) ) ); <---------------- Warning Here
--------------------------------------------------- End Code ----------------------------------------------------------
wxWidgets: 3.0.2
OS: Linux Btfsplk 2.6.32-696.6.3.el6.x86_64 #1 SMP Fri Jun 30 13:24:18 EDT 2017 x86_64 x86_64 x86_64 GNU/Linux
Compiler: gcc
Gtk Warning on Linux when setting a bit mask
Re: Gtk Warning on Linux when setting a bit mask
Code: Select all
fill_pattern_p->pWX_bitmap->SetDepth(1) ;
Try the wxMask ctor that takes an additional colour parameter.
Use the source, Luke!