Replies: 3 comments 3 replies
-
Okay, I found that you set |
Beta Was this translation helpful? Give feedback.
-
I would definitely recommend to not use an on screen canvas bigger
than what is visible and when needing to do the snapshot draw
everything offscreen using the imperative API. Currently, you would
need to redraw everything using a different API (declarative onscreen,
imperative offscreen) but I'm sure there is a way to nicely structure
your code to achieve the desired result.
This looks interesting, keep us posted.
…On Wed, Aug 30, 2023 at 3:06 PM Matas ***@***.***> wrote:
But the problem still stays the same. If I set the Canvas size bigger than device width then the content is offscreen. But I want to be able to see the content on screen.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
@alarm109 - did you come up with any ways to use .makeImageSnapshot() when the Image has been panned and zoomed? I'm not clear on how to adjust the rect argument with the matrix used to transform the image/ gesture handler. Hence, the snapshot does not reflect the the correct rect after the image is manipulated. |
Beta Was this translation helpful? Give feedback.
-
I'm trying to do a PhotoAdjustmentScreen, where we allow user to adjust Image to specific aspect ratio. I have
Canvas
component withImage
inside it. AndGestureHandler
to move theImage
around inCanvas
to achieve desired position. And then save the Image in the maximum possible resolution.Problem
When I'm trying to save image with from snapshot
canvasRef.current?.makeImageSnapshot()
. The width and height is1179
, because the screen width is 393 and aspect ratio 1:1. But the original image size is 3000x2000px and I can't save the image bigger than1179
.What I'm trying to achieve
My goal is to make the canvas size the minimum size of image dimension in this case 2000px. So I would like to make canvas size 2000x2000px, but I want to be able to see everything on screen. How do I achieve this? I need to fit 2000x2000 size canvas on the screen when the maximum screen width is 393px.
Is it possible to make canvas the size of 2000x2000 and then scale it down to the screen width, so that I could see everything?
Maybe there is a better approach to achieve this?
An example showing how to add an
Image
toCanvas
, display the whole Image on screen and just saving it in the same dimension as the original would be very helpful. 🙏You can see my example code below.
Beta Was this translation helpful? Give feedback.
All reactions