Skip to content

Expected Skimage object for the image property #1686

Answered by mbenmass
chridubois asked this question in Q&A
Discussion options

You must be logged in to vote

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> 
); 
};

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@wcandillon
Comment options

Answer selected by wcandillon
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants