Reputation: 11
Is it somehow possible to use Dart to get pixel colour of the ImageElement
? I am looking for something very similar to Canvas's context method "getImageData", but for the ImageElement
. I was thinking about printing the image to the canvas and then use the getImageData
function, but this is not very nice way to do it. Thank you.
Upvotes: 1
Views: 528
Reputation: 2547
Dart has a class CanvasRenderingContext2D
( https://api.dartlang.org/docs/channels/stable/latest/dart_html/CanvasRenderingContext2D.html ) with
ImageData getImageData(num sx, num sy, num sw, num sh)
Upvotes: 1