Skip to content

getImageData #237

@almognoam

Description

@almognoam

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions