Re: First time pygoocanvas user



Le mardi 15 septembre 2009 à 19:07 -0500, Nick Peters a écrit :
> Hello,
> 
> I have been developing an application that is basically a glorified
> paint program, allowing the user to draw a few shapes with the mouse (as
> well as lines). For a few days i have been stumped on how to get an
> "eraser" tool to work. I assume that it would be much like the drawing
> tools, only triggered when the mouse hits an item that the user has
> drawn using the enter_notify_event when the user has the eraser tool
> selected.
> 
> I am however having a hard time, figuring out how to modify the item the
> mouse comes into contact with. I know how to setup the event, but i am
> unsure on what to edit or how to go about doing it. The pygoocanvas
> examples that i have looked at, mostly deal with pure drawing, and
> nothing to do with "erasing" part of an item (if there is an example,
> please say so and i can go out on the net and read about it). I have
> also had no luck with google searches on the subject.
> 
> Has anybody on the list have experience in doing such an operation with
> pygoocanvas? Am i going about it in the wrong way? Any suggestions would
> be great!

Hi,

You van check GCompris in it's gcomprixogoo development branch [1].
There is a drawing and animation tool based on goocanvas under
src/anim-activity.

By the way it seems like you are confusing vector drawing and bitmap
drawing.

In vector drawing like goocanvas is good at, you keep a list of shapes
like ellipse, rectangles and their properties like color, gradiant, ....
You can at any time edit shapes, moves them change their properties and
their z-axis (in front / on the back).

In bitmap drawing, you keep a list of pixels, and their colors. You
cannot manipulate the shapes once they have been painted on the
'screen'.

[1] http://gcompris.net/wiki/index.php/Developer's_corner

Bruno.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]