Draw low resolution-image on cavas but export cavas with highest resolution #1355
-
Hi, I have a large image with original size is 3468x4624 pixel. I created SkiaView with size fit to the phone screen, and draw skImage to SkiaView (skImage's resolution has been reduced to fit to the SkiaView, and the size of SkiaView was created small to keep performance), I also drawed some rectangles on it. const onDrawImage = useDrawCallback(
(canvasImage, info) => {
canvasImage.drawImageRect(
skimage,
{
x: 0,
y: 0,
width: skimage.width(),
height: skimage.height(),
},
{
x: (VIEW_WIDTH - imageSizeOnCavas.width) / 2,
y: (VIEW_HEIGHT - imageSizeOnCavas.height) / 2,
width: imageSizeOnCavas.width,
height: imageSizeOnCavas.height,
},
Skia.Paint(),
);
// draw some rectangles, paths on it
}
},
[],
); <Animated.View
style={[
{
height: VIEW_HEIGHT,
width: VIEW_WIDTH,
},
]}>
<SkiaView
ref={skImageRef}
onDraw={onDrawImage}
style={{
flex: 1,
}}
/>
</Animated.View> |
Beta Was this translation helpful? Give feedback.
Answered by
wcandillon
Feb 15, 2023
Replies: 1 comment
-
As you guessed already you need to use offscreen rendering for that: #1359 (comment) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
hungtooc
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As you guessed already you need to use offscreen rendering for that: #1359 (comment)