Unplanned
Last Updated: 10 Mar 2023 10:24 by ADMIN
Legrand
Created on: 09 Mar 2023 16:28
Category: ImageEditor
Type: Feature Request
0
ImageEditor: Provide an option to retrieve the pixel on image in the editor

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;
        }
3 comments
ADMIN
Didi
Posted on: 10 Mar 2023 10:24

Hello Legrand,

I have updated the status of the item to Unplanned as this is a valid feature request. Thank you for this request. 

Regards,
Didi
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Legrand
Posted on: 10 Mar 2023 08:50

Hello,

I need to pick the color of a pixel on a photo. As the photo may have a size up to 12000 x 9000 pixel, I need to zoom/move the image in the ImageEditor to click on the pixel (zone) I want to retrieve the color.

I hope it is clear enough.

 

ADMIN
Didi
Posted on: 10 Mar 2023 08:36

Hello Legrand,

Could you please share more details on the exact scenario you want to achieve? Why pixel is needed? For example if the image is zoomed, one pixel of the screen won't match the pixel of the image. 

Looking forward to your reply of the exact use-case you have.

Regards,
Didi
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.