From: Arjan M. <arj...@he...> - 2005-02-14 07:52:16
|
Hi, Phillip Neumann wrote: > > Hello... > > Im new to diacanvas, and i wonder how to draw a circle on the canvas. You can have a look at demos/dia-clock.c. I think it contains all the data you need (but it's in C). Basically all you need to do is inherit from CanvasElement and create a diacanvas.shape.Ellipse instance in your constructor. In the on_update(self, affine) method you resize it so it has the same width and height as the "width" and "height" properties of your object. I beleive I've drawn a circle in one of the .py examples as well. > anyone would give me a tip? > > all i can do i draw a CanvasBox.... CanvasBox is a default (example) class which draws only a box. I have no such a thing for circles. > what about a png image?.. You can use CanvasImage to draw one. It cannot be exported to SVG however. If you have any more questions please do not hesitate to ask. Regards, Arjan > > > thank you in advance, > > > PD: im using python > > |