iddan / react-native-canvas

A Canvas component for React Native
MIT License
981 stars 172 forks source link

getImageData #237

Closed almognoam closed 2 years ago

almognoam commented 2 years ago

im trying to get the pixels of the screen by getImageData:

let ctx = canvas_ref.current.getContext('2d')
const pixel_arr  = ctx.getImageData(0, 0, screenWidth, screenHeight).data

but i get this error:

Error: Failed to execute 'getImageData' on 'CanvasRenderingContext2D': The canvas has been tainted by cross-origin data.

i've being looking online but noting works, any idea how to fix it?