Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to get the result as Image instead of rendering to canvas? #89

Open
thangaraja opened this issue Dec 19, 2019 · 2 comments

Comments

@thangaraja
Copy link

Hi,

I am working on a project in which the SMILE need to be prepared as the API. So the UI can be handled by the consuming application.

Is there a way to generate the result as an image?

@robertf224
Copy link

@thangaraja you could grab the context of the canvas after rendering and use getImageData (https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/getImageData)

@robertf224
Copy link

robertf224 commented Jan 7, 2020

or if you're going to render the image with an image tag you can use toDataUrl https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toDataURL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants