Corsair
Corsair

Reputation: 1044

GWT Canvas painting on server side?

for my GWT app i am tranferring Data to the client which is using the data to draw on a canvas. The Problem is that the tranfer of this data consumes too much bandwidth.

My question is: could I create a png file in a similar way on the server and just send it to the Client?

Upvotes: 0

Views: 388

Answers (1)

Ümit
Ümit

Reputation: 17489

Yes that should be no problem. There are two ways to solve it.

  1. If you just want to display the image: Create a IMG widget and set the src to a server url which generates the PNG. (<img src="http://myHost/loadImage?id=12">

  2. If you want to work with the image: Use RequestBuilder to transfer the PNG to the client. See here and here for more details.

Update: For the backend side there are also different solutions:

  1. Server-side node canvas
  2. Use JAVA libraries to generate PNGs (see here for more details)

Upvotes: 1

Related Questions