drawing on wxDC with transparency

Xavier Miller xavier.miller at cauwe.org
Thu May 8 07:30:55 PDT 2008


Hello,

I have the same problem as you.

All I did is using a wxGCDC :

	wxMemoryDC memDC(buf);
	wxGCDC gcDC(memDC);
	gcDC.SetBackground(*wxTRANSPARENT_BRUSH);
	gcDC.Clear();
	// draw a red rectangle
	gcDC.SetBrush(*wxRED_BRUSH);
	gcDC.SetPen(*wxTRANSPARENT_PEN);
	gcDC.DrawRectangle(10, 10, 30, 30);

	// draw the same rectangle from a file
	gcDC.DrawBitmap(file_, 50, 00, true);

Xavier.

personaje a écrit :
> bump,
> 
> any thoughts?
> 
> On Wed, May 7, 2008 at 2:23 PM, personaje <personaje at gmail.com> wrote:
>> On Wed, May 7, 2008 at 2:16 PM, Robert Roebling <robert at roebling.de> wrote:
>>  >
>>  >  personaje wrote:
>>  >
>>  >  >    I want to draw on a  bitmap usign wxDC's primitives and keep
>>  >  > everything transparent except for the parts I draw on (using mainly
>>  >  > DrawPolygon, with a wxPen and wxTRANSPARENT_BRUSH).
>>  >  >
>>  >  >    I am getting a completely transparent bitmap. I read on the wxDC
>>  >  > help page the note about Transparency / Alpha channel for wxMAC. My
>>  >  > question is: All other platforms don't support transparency/alpha?
>>  >
>>  >  Consider using wxGraphicsContext,
>>
>>  is that because wxDC doesnt support what I am trying to do?
>>  I am worried that I am doing something wrong that won't work even with
>>  wxGraphicsContext
>>
>>  Regards.
>>
> _______________________________________________
> wx-users mailing list
> wx-users at lists.wxwidgets.org
> http://lists.wxwidgets.org/mailman/listinfo/wx-users


More information about the wx-users mailing list