i want to Generate .png image in GWT
Does anyone know about this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
With GWT 2.4, and HTML canvas, you can do it on the browser side. Create a canvas element, draw whatever you want on it and then get a data url which contains the image as png data. This will only work on browsers that support it (most modern browsers do, IE <= 8 won’t support it as far as I know but you can use explorercanvas).
Example code (untested):
At the end of this code,
pngDataUrlwill have the png image encoded as a data url.imagewill display the canvas’ contents as a regular PNG image in the browser.