Is there a way to retrieve a pixel of the image in the imageEditor when clicking on it
I could implement something working well , but not when the image is zoomed or moved in the editor
public static Point Calc_Coordinates(double w_image, double h_image, double w_container, double h_container, double click_x, double click_y)
{
Double zoomW = (w_container / w_image);
Double zoomH = (h_container / h_image);
Double zoomActual = Math.Min(zoomW, zoomH);
Double padX = zoomActual == zoomW ? 0 : (w_container - (zoomActual * w_image)) / 2;
Double padY = zoomActual == zoomH ? 0 : (h_container - (zoomActual * h_image)) / 2;
Point res = new Point();
res.X = (Int32)((click_x - padX) / zoomActual);
res.Y = (Int32)((click_y - padY) / zoomActual);
//
if (res.X < 0 || res.X > w_image) { res.X = -1};
if (res.Y < 0 || res.Y > h_image) { res.Y = -1};
return res;
}