Issue with directly converting Json to Image #10249
Unanswered
SkullKrusher7
asked this question in
Q&A
Replies: 1 comment 1 reply
-
You have to size the canvas correctly and use the viewport to just output a part of the design in the canvas. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am having issues when trying to convert json stored in my db directly into image.
This is the output I expect
This is what I get
![image](https://private-user-images.githubusercontent.com/76239084/382492650-a10444ea-1ccb-44cb-ad4c-48b9acbd7cb0.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzNTQ3NzUsIm5iZiI6MTczOTM1NDQ3NSwicGF0aCI6Ii83NjIzOTA4NC8zODI0OTI2NTAtYTEwNDQ0ZWEtMWNjYi00NGNiLWFkNGMtNDhiOWFjYmQ3Y2IwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEyVDEwMDExNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTYyMDQ3MmM5N2FmOTc0MGJiNGJhMWE4YTUyOGFkYzI5MDljNzhhYmM4ZWE4NDcyOGE5MDVjMTAyZWUwNDRlZWMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.emo0ec0j92OTxrcrPaIYQafH6vGErlZls6UiBS4ojwQ)
On my canvas I have an object that is partly outside of the canvas, and I think it looks great, but as soon as I run toDataURL() on the canvas in order to export it as a PNG it includes the entire object in the resulting image. I am wondering if there is a way to "cut off" all objects that are outside or partly outside of the canvas.
Beta Was this translation helpful? Give feedback.
All reactions