How to save high resolution image canvas to server using asp.net?

In  HTML5 canvas how can i save the drawing as Jpeg or png with a desired resolution?

  • Suppose i have two Photos of large resolution say 3000x2000px  and i scale them using canvas transformation function and place both of them side by side on a 1024x768px canvas. but now i want to save this as an image file which is high resolution say 3000x2000 . To understand it better Take the Example of photoshop where in our worksapce is small but we can save large resolution Pictures. I want to make some thing similar.

  • Answer:

    To save the images (on a server) you can export from the canvas with base64 encoding, send the raw data to the server and decode it on the backend. In order to scale down the image for the user, but still save the big image you can use a copy of the canvas element. You can create a second hidden canvas before the scaling and use it for exporting the big image. The user will still works only on the visible canvas with a smaller image. This is not a very elegant solution, but as an amateur with the canvas I think it works pretty well.

Haralan Dobrev at Quora Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.