RE: [Boa Constr] newbie question -- using Boa for creating a drawing canvas
Status: Beta
Brought to you by:
riaan
From: John B. <joh...@om...> - 2002-07-05 02:21:12
|
Thanks Riaan. I had to modify your suggestion a bit to get it working. Here is what I used: class wxBoaShapeCanvas(wxShapeCanvas): def __init__(self, parent=NULL, id=-1, pos=wxPoint(224, 16), size=wxSize(200, 304), style=wxBORDER, name='shapecanvas'): wxShapeCanvas.__init__(self, parent, id, pos, size, style) self.SetName(name) That seems to work OK. I have another question though. I would like to place a bitmap (or gif if I could) on the canvas and then be able to rotate it when I want. I could use the static bitmap control in Boa, but that references a filename for the bitmap. So if I want to rotate it (using image.Rotate() from PIL), I would have to open the file, rotate it, save it to a temp file, and then open it again with the bitmap control. Is there a more efficient way to do this? Unfortunately, wxShapeCanvas does not have methods to paste a bitmap to the canvas. I am very new (to OOP, Python, Boa), so maybe I am missing something here that would make the job easy. Any suggestions are appreciated. John John Boik Oregon Medical Press www.ompress.com joh...@om... |