image must be initialized with a canvas instance
See original GitHub issue<View
onStartShouldSetResponder={() => true}
onResponderStart={this.mouseDownListener}
onResponderMove={this.mouseMoveListener}
onResponderRelease={this.mouseUpListener}
style={{
// flexGrow: 1,
height: canvasHeight,
alignItems: "center",
marginTop: (3 * h) / 100
}}
>
<View>
<View
style={{
height: canvasHeight,
width: bgWidth
// backgroundColor: "green"
}}
>
<Image
source={bgImg}
style={{
// flexGrow: 1,
width: null,
height: "100%"
}}
resizeMode="contain"
/>
</View>
<View
style={{
height: canvasHeight,
width: bgWidth,
position: "absolute",
alignItems: "center"
}}
>
<Canvas
ref={this.handleCanvas}
style={
{
// backgroundColor: "red"
}
}
/>
</View>
</View>
</View>
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (5 by maintainers)
Top Results From Across the Web
'react-native-canvas' return `Error: Image must be initialized ...
I read some issues on github, but It does not work for me. Here's my code : import Canvas, { Image as CanvasImage...
Read more >Image must be initialized with a Canvas instance`-React Native
Coding example for the question 'react-native-canvas' return `Error: Image must be initialized with a Canvas instance`-React Native.
Read more >Image Manipulation with Fabric.js and Canvas - Pieces.app
As soon as the canvas is initialized, you can select objects, drag them around, scale them, rotate them, and group them in order...
Read more >ImageData() - Web APIs - MDN Web Docs
An unsigned long representing the width of the image. ... Initializing ImageData with an array ... const canvas = document.
Read more >React Native with Canvas rendering - Questions - Babylon.js
I've been working on code to render panorama images in React Native. ... the camera's rotation quaternion is initialized correctly. camera.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Canvas is not initialized when calling new CanvasImage. Something to do with render method of react-native. Seems I solved the problem with little workaround. Checking if canvas is set before CanvasImage does its own check.
Hi, @iddan, I alse have this problem. I got
Error: Image must be initialized with a Canvas instance
. Here is my code :