gdi+ - WxWidgets draw a bitmap with opacity -


how can draw wximage, or wxbitmap dc opacity? looks not possible standard dc or wxgraphicscontext.

beginlayer/endlayer not yet implemented in wxgraphicscontext have been 1 solution. gdi+ doesn't seem support layers, non-trivial add this.

the solution seems to programmatically alter alpha channel pixel-by-pixel?

void yourcustomwindow::onpaint( wxpaintevent& event ) {   wxpaintdc dc(this);   wximage image( width, height );    image.initalpha();   unsigned char* imgdata = img.getdata();   unsigned char* imgalpha = img.getalpha();     // manipulate raw memory buffers populate   // them whatever image like.   // putting zeros everywhere create   // transparent image.        // done, not quite...       // wxdc can draw wxbitmaps, not wximage,      // 1 last step required   //   wxbitmap bmp( image );   dc.drawbitmap( bmp, 0, 0 );  } 

Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -