I am trying to make some translucent circles, and it isn't happening.  The code
below should have the red bleed through everything else, but everything else is
opaque.

Also, why do I need .Canvas for .NavCanvas(self).Canvas when I don't for
FloatCanvas(self)?

Also, the circle border does not scale.  Initially the black border and yellow
fill are about the same width.  hit "Zoom to Fit" and everything gets bigger,
except for the width of the border.

Carl K

#!/usr/bin/python
# fca.py
# FloatCanvas Alpha channel test.


import wx
from wx.lib.floatcanvas import NavCanvas, FloatCanvas

class TestFrame(wx.Frame):

     def __init__(self, *args, **kwargs):

         wx.Frame.__init__(self, *args, **kwargs)

         # self.canvas = FloatCanvas.FloatCanvas(self)
         # Why does the next line need .Canvas if the above does not?
         self.canvas = NavCanvas.NavCanvas(self).Canvas

         self.canvas.AddRectangle((10,10), (100, 20), FillColor="red")

         gcol = wx.Colour(0,255,0,128)
         self.canvas.AddRectangle((20,20), (100, 20), FillColor=gcol)

         radius = 50
         # alpha chanel ignored.
         lColor= wx.Colour(0, 0, 0, 128)
         # LineWidth does not scale.
         lWidth = 25
         fColor= wx.Colour(255, 255, 0, 128)

         self.canvas.AddCircle( (60,30), radius,
                          LineColor = lColor,
                          LineWidth = lWidth,
                          FillColor = fColor )


app = wx.App(0)
frame = TestFrame(None)
frame.Show(True)
app.MainLoop()

_______________________________________________
FloatCanvas mailing list
[email protected]
http://mail.mithis.com/cgi-bin/mailman/listinfo/floatcanvas

Reply via email to