[Gambas-user] gb.web.gui and Canvas

Benoit Minisini benoit.minisini at gambas-basic.org
Mon Aug 1 01:05:29 CEST 2022

Le 31/07/2022 à 22:22, Bruce Steers a écrit :
> On Sun, 31 Jul 2022 at 20:59, Benoit Minisini 
> <benoit.minisini at gambas-basic.org 
> <mailto:benoit.minisini at gambas-basic.org>> wrote:
>     Le 31/07/2022 à 21:44, Bruce Steers a écrit :
>      > Anything been considered with html Canvas?
>      > https://www.w3schools.com/tags/ref_canvas.asp
>     <https://www.w3schools.com/tags/ref_canvas.asp>
>      > <https://www.w3schools.com/tags/ref_canvas.asp
>     <https://www.w3schools.com/tags/ref_canvas.asp>>
>      >
>      > Looks like some kind of WebPaint.class could be added to gb.web.gui.
>      >
>      > Respects
>      > BruceS
>      >
>     Yep. The difficulty is keeping the state of the canvas on the server.
> Dang, i was thinking of a brand new era of hand draw controls.. :)
> I guess small image data could work using gb.image serverside and just 
> keep painting it onto canvas. (i guess image data can be sent somehow 
> from server and not just loaded from a file refresh)
> An initial Image maker i guess is easy enough to use gb.image to save a 
> on-the-fly made image to server for page to read.
> gonna look into canvas though and see what i can accomplish :)
> (fancy sharing any test sources ?)
> Respects
> BruceS

To keep the canvas state, you have to store on the server all the 
javascript associated with the requested drawing commands, so that the 
canvas can be redrawn at any time.

Or better, you have an intermediate representation of the drawing 
commands, that are then translated to javascript on demand. You only 
store the intermediate representation, that should be concise.

You can imagine then a method to upload the canvas contents to the 
server, but that needs support from 'gb.web.gui' 'lib.js' library.


Benoît Minisini.

More information about the User mailing list