F
F
FishNinja2014-11-19 14:25:33
JavaScript
FishNinja, 2014-11-19 14:25:33

Get canvas pixel color with position:absolute?

Hello, you need to get the color of a pixel in a picture at a point.
I did everything as it is written here easy-code.ru/lesson/html5-canvas-color-picker - it works. BUT. When the canvas is drawn in a box with an absolute position, the color cannot be retrieved.
That is, I have a "popup window" that contains a canvas:

<div style="position:absolute; top:100px; left:100px;">
<canvas id='img'></canvas>
</div>

getImageData returns null values.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question