drawing to wxBitmap with alpha channel

DM D.Marcinkiewicz at elka.pw.edu.pl
Wed Oct 11 07:06:00 PDT 2006


On Tue, Oct 10, 2006 at 01:13:12PM +0200, Vadim Zeitlin wrote:
> On Tue, 10 Oct 2006 13:00:24 +0200 Dariusz Marcinkiewicz <D.Marcinkiewicz at elka.pw.edu.pl> wrote:
> 
> DM> I cannot figure out from the documentation how to draw
> DM> to wxBitmap that has an alpha channel using wxMemoryDC.
> 
>  Up until (not quite released yet) 2.7.1 there is no way to draw using
> alpha in wxWidgets, you must pass by wxImage or wxRawBitmap, i.e. you're
> limited to single pixel access. The new wxGraphicsContext class in 2.7.1
> will allow doing what you want though (using Cairo in wxGTK).
> 
Ok, thank you. 

Does the proper method to draw onto a wxBitmap looks like this in 2.7.1?

wxBitmap b = wxBitamp(w, h, 32);
wxMemoryDC mdc;
b.SelectObject(b);
wxGraphcsContext gc(mdc);

As I understand, now I can set alpha value for color that is used by wxPen.

-- 
DM




More information about the wx-users mailing list