Expected Skimage object for the image property #1686
-
Hi, I'm trying to use React Native Skia to build a complex image color picker with pan/pinch zoom. I'm trying to draw an image in a canva using this code :
Unfortunately, I'm getting this issue : "Expected SkImage object for the image property" I'm using Expo. Do you know how can I fix it ? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Try this : import { Canvas, Image, useImage } from "@shopify/react-native-skia";
const ImageDemo = () => {
const image = useImage(require("./assets/oslo.jpg"));
if (image == null) return null;
return (
<Canvas style={{ flex: 1 }}>
<Image image={image} fit="contain" x={0} y={0} width={256} height={256} />
</Canvas>
);
}; |
Beta Was this translation helpful? Give feedback.
-
Perfectly working ! Thanks a lot ! What is the last version please ? |
Beta Was this translation helpful? Give feedback.
Try this :