Forum: Ruby on Rails Canvas Tag + Rails Ajax

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Dc7397c6c2d24544316df21caa42fce7?d=identicon&s=25 lgalea (Guest)
on 2005-11-27 18:24
(Received via mailing list)
Hi all,

Just looking for a quick sanity check. I was thinking of writing a
plugin for rails to give rails developers a good way of using the new
firefox 1.5/safari canvas tags. I was thinking of grabbing an
existing ruby graphics library and modifying it so that it renders
via the canvas tag..

So you could have link_to_remote pointing to controller actions that
instead of returning html would return "something" that results in
canvas drawing.

Does this sound at all reasonable? Any specific libraries anyone
could suggest that might be a good point to start from?
Dc7397c6c2d24544316df21caa42fce7?d=identicon&s=25 lgalea (Guest)
on 2005-11-27 18:53
(Received via mailing list)
I should mention it was trivial to get ajax calls to the controller
which returns javascript to draw to the canvas working..

The harder part will be to have a "javascript renderer" for an
existing gui/graphic library.
A2b2f4ee23989dc68529baef9cbddcd6?d=identicon&s=25 listbox (Guest)
on 2005-11-27 20:26
(Received via mailing list)
On 27-nov-2005, at 18:52, Luke Galea wrote:

> I should mention it was trivial to get ajax calls to the controller
> which returns javascript to draw to the canvas working..
>
> The harder part will be to have a "javascript renderer" for an
> existing gui/graphic library.

I don't quite get why you would need something like that. As I know
you can just load a PNG into the canvas, and pick this PNG from there
after it has been edited. Drawing with canvas is more of a raster-
based state machine so I guess it makes much more sence to store
versioned raster images instead of drawing commands for the canvas. A
use I recently envisioned for my app would be to just allow people
"scribble" on a picture and then save the created PNG back to server.

I think you could probably use difference matting to let your
"scribbled" versions compress better (i.e. equalize all the pixels
which didn't change after scribbling).
30269682335f1fb247d71969fa715b5e?d=identicon&s=25 Roberto Saccon (rsaccon)
on 2005-11-27 21:59
(Received via mailing list)
if you need an impressive demo of what canvas is capable to do, check
out
this, it got slashdotted today:

http://www.abrahamjoffe.com.au/ben/canvascape/

have fun
This topic is locked and can not be replied to.