Hey,
Drawing with alpha is a bit problematic, but one thing to try:
dc = wx.MemoryDC(bmp)
dc.SetBrush(wx.WHITE_BRUSH)
dc.DrawCircle(256,256,256)
Try using four channel colors:
dc.SetBrush(wx.Brush(wx.Color(255,255,255,255))) # opaque white
and you may want to clear the DC with a background color with the
alpha you want:
dc.SetBackgroundColour(wxColour(0,0,0,0))#transparent
dc.Clear()
untested, but worth a shot.
-Chris
···
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker@noaa.gov
Thanks for the suggestion, but that doesn’t seem to make any difference. I already had confirmed that the way I was doing actually does do the right thing if you ask the DC, but doesn’t make it back to the bitmap.
···
On Sunday, December 30, 2012 2:48:11 AM UTC-5, Chris Barker - NOAA Federal wrote:
Hey,
Drawing with alpha is a bit problematic, but one thing to try:
dc = wx.MemoryDC(bmp)
dc.SetBrush(wx.WHITE_BRUSH)
dc.DrawCircle(256,256,256)
Try using four channel colors:
dc.SetBrush(wx.Brush(wx.Color(255,255,255,255))) # opaque white
and you may want to clear the DC with a background color with the
alpha you want:
dc.SetBackgroundColour(wxColour(0,0,0,0))#transparent
dc.Clear()
untested, but worth a shot.
-Chris
–
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris....@noaa.gov
Thanks for the suggestion, but that doesn't seem to make any difference. I
already had confirmed that the way I was doing actually does do the right
thing if you ask the DC, but doesn't make it back to the bitmap.
darn -- try using a GraphicsContext instead -- alpha is kind of hacked into DCs.
-Chris
···
On Sun, Dec 30, 2012 at 7:28 AM, Ben Buchwald <sparkyb@gmail.com> wrote:
On Sunday, December 30, 2012 2:48:11 AM UTC-5, Chris Barker - NOAA Federal > wrote:
Hey,
Drawing with alpha is a bit problematic, but one thing to try:
> dc = wx.MemoryDC(bmp)
> dc.SetBrush(wx.WHITE_BRUSH)
> dc.DrawCircle(256,256,256)
Try using four channel colors:
dc.SetBrush(wx.Brush(wx.Color(255,255,255,255))) # opaque white
and you may want to clear the DC with a background color with the
alpha you want:
dc.SetBackgroundColour(wxColour(0,0,0,0))#transparent
dc.Clear()
untested, but worth a shot.
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris....@noaa.gov
--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker@noaa.gov
Chris Barker - NOAA Federal wrote:
···
On Sun, Dec 30, 2012 at 7:28 AM, Ben Buchwald <sparkyb@gmail.com> wrote:
Thanks for the suggestion, but that doesn't seem to make any difference. I
already had confirmed that the way I was doing actually does do the right
thing if you ask the DC, but doesn't make it back to the bitmap.
darn -- try using a GraphicsContext instead -- alpha is kind of hacked into DCs.
This is true. GDI on Windows, for example, does not support alpha at
all for brushes and pens, and primitives like rectangles and circles.
In general, the primitives are all drawn with alpha=1, erasing whatever
was there before. You have to use the specific alpha-oriented APIs.
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.