everybody,
I need to get the color of my image that is in my canvas object.
That's what I am doing right now:
_canvas.getContext('2d').getImageData(event.offsetX, event.offsetY, 1, 1).data;
This is what I want, but I have two images... one does'nt have color just de draw... the other is the same, but with color in each part... I want to show to the user.. the image without color... and when mouse hover... get the "back" color.
I hope you understand what I am trying to do here.
I am adding the image in this way:
loadIMLImage(context, "http://localhost:51413/img/image_color.png");
loadIMLImage(context, "http://localhost:51413/img/image.png");
and this is the method
function loadIMLImage(context, source) {
base_image = new Image();
base_image.src = source;
base_image.onload = function () {
context.drawImage(base_image, 100, 100);
}
return base_image;
}
Any help will be appreciated.