Hi,
I experienced this problem several months ago (on the Boa Constructor
project).
I could not get the text to appear using a multi-part shape.
I wrote the following function to Flush the Text. It basically looks at each
region in the shape and repaints the text.
def FlushText(self):
"""This method retrieves the text from the shape
regions and draws it. There seems to be a problem that
the text is not normally drawn. """
canvas = self.GetCanvas()
dc = wxClientDC(canvas)
canvas.PrepareDC(dc)
count = 0
for region in self.GetRegions():
region.SetFormatMode(4)
self.FormatText(dc, region.GetText(), count)
count = count + 1
I have no knowledge of the images, bitmaps etc.
Kevin
wxpython@lee-morgan.net wrote:
···
Hi,
My shape is always blank without text.
I've used the demo code in a seperate app and tried adding to 'shapes'
list, adding independently to canvas.I've tried loading bitmap through wxBitmap,wxImage,PIL and
wxBitmapShape.I've tried setting pens, brushes.
I'm now running out of ideas!
Cheers
Lee
code:
self.bitmap = self.image.ConvertToBitmap() # ie from wxImage RGB
bm = wxBitmapShape()
bm.SetCanvas(self) # self is a wxShapeCanvas
bm.SetDraggable(true)
bm.AddText("here")
bm.SetBitmap( self.bitmap )
bm.SetX(140)
bm.SetY(255)
background.SetSize(self.bitmap.GetWidth(),self.bitmap.GetHeight())
## bm.SetPen(wxBLACK_PEN)
## bm.SetBrush(wxBLACK_BRUSH)bm.Show(true)
bm.Move(dc, bm.GetX(), bm.GetY())
--
wxPython_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/wxpython-users