On Fri, Jan 7, 2011 at 19:30, Gycoder <[email protected]> wrote:

> I've created a web-based painting program using canvas and javascript.
> It seems better than other programs that I know as http://canvaspaint.org,
> http://caimansys.com/painter/... e.g, with my Gypaint, somebody can
> insert an image, make a few simples edits, then save to a new version
> without any HTTP request or response, user also can draw and export a
> selected part or the whole picture... Gypaint also supports a number
> of familiar keyboard shortcuts as in MS Paintt or GIMP.
>
> But, I'm having a little trouble handling the coloring of the
> drawings  was painted  in the picture. The basic shapes such as
> circle, oval... after they are drawn down in the form of contour, but
> then somebody want to fill up, how to refer to them by script? Please
> give me some suggestions to solve this problem. Thanks.
>

Try using SVG object as a "stamp" that creates impression on your canvas.
This way you can reuse this svg object "stamp" for a reference to make
changes later on.

OTOH... any such action is defective by design, because you're mixing vector
graphics with raster, so you're painting "apples with oranges".

If I'd do something like that I'd rather use http://raphaeljs.com/ as the
base and created a vector based canvas to paint on. Freehand lines can still
be drawn by repeating simple circle as the cursor moves and
merging/smoothing them at the mouseup. You could still export raster result
at the end.

-- 
To view archived discussions from the original JSMentors Mailman list: 
http://www.mail-archive.com/[email protected]/

To search via a non-Google archive, visit here: 
http://www.mail-archive.com/[email protected]/

To unsubscribe from this group, send email to
[email protected]

Reply via email to