I have checked this question which provides the perfect answer. But my problem is slightly different. I have a canvas of 300 x 300
and i am re-sizing the canvas using css
to 200 x 60
. If i re-size the canvas using css i am not able to get the color value onmouseover
.
In the re-sized fiddle if you mouse over right below the red or blue rectangles you will notice it still says #FF0000
& #0000FF
respectively while it should be #000000
. So how to make it work even with re-sized canvas?
Fiddle: Re-sized with css.
Fiddle: Non re-sized.