This is a migrated thread and some comments may be shown as answers.

how to implement magnifier in radImageEditor

6 Answers 361 Views
ImageEditor
This is a migrated thread and some comments may be shown as answers.
fazera
Top achievements
Rank 1
fazera asked on 21 May 2020, 01:44 AM
Hi, I'm trying to add magnifier for zooming on main image in my radImageEditor. I already see the magnifier demo but I do not understand how to implement in my radImageEditor. Currently, I'm using mouse wheel zooming.

6 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 21 May 2020, 04:55 AM
 

Hello, Fazera,  

RadImageEditor supports zooming and provides a track bar for sliding the zoom factor out of the box. Please refer to the attached gif file. I believe that it would fit your scenario for zooming the images.

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
fazera
Top achievements
Rank 1
answered on 15 Jul 2020, 06:56 AM

Hey Dess, Thank you for reply.

 

Yes I know that RadImageEditor supports zooming and provides a track bar for sliding the zoom factor out of the box, but my client want better zooming like magnifying zooming or can zooming the image at current mouse location?

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 16 Jul 2020, 06:56 AM
Hello, Fazera,

Currently, such functionality is not supported in RadImageEditor. However, if other customers have similar request, we will definitely consider it in the future improvement of the control.

You can have a look at the following KB article which demonstrates a sample approach how to create a control that allows pan and zoom functionality for images that may be suitable for your case: https://docs.telerik.com/devtools/winforms/knowledge-base/pan-and-zoom-image-control 

Please have in mind that this is just a sample approach and it may not cover all possible cases. Feel free to modify and extend it in a way which suits your requirements best. 

Should you have further questions please let me know.

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

0
fazera
Top achievements
Rank 1
answered on 20 Jul 2020, 10:11 AM

Hye Dees, thank you for replying.

So now my current implementation for zooming is user can zoom the current image by scroll the mouse. It is ok, but my expectation, I want user zoom when the cursor place at the image.How can I zoom at current mouse location in the image?

 

This is my code,

 

 private void OnMouseWheel(object sender, MouseEventArgs mea)
         {
            try
            {
                if (mainImageEditor.CurrentBitmap != null)
                {
                    if (mea.Delta > 0)


                    {
                        SizeF currzoom = new SizeF(mainImageEditor.ZoomFactor.Width * 1.1f, mainImageEditor.ZoomFactor.Height * 1.1f);
                        mainImageEditor.ZoomFactor = currzoom;
                        mainImageEditor.ImageEditorElement.StartPan();
                       

                    }
                    else
                    {
                        SizeF currzoom = new SizeF(mainImageEditor.ZoomFactor.Width * 0.9f, mainImageEditor.ZoomFactor.Height * 0.9f);
                        mainImageEditor.ZoomFactor = currzoom;
                     
                    }
                }
            }
            catch (Exception) { }
        }

 

and the result as attached.

0
Accepted
Dess | Tech Support Engineer, Principal
Telerik team
answered on 20 Jul 2020, 12:04 PM

Hello, Fazera, 

Zooming in an image considering the mouse position seems to be more like a general programming question. After some research, I have found the following threads that may be suitable for achieving your requirement: https://stackoverflow.com/questions/10694397/how-to-zoom-in-using-mouse-position-on-that-image

I have logged it in our feedback portal by creating a public feature request on your behalf. You can track its progress, subscribe for status changes and add your comments on the following link - feedback item.

I have also updated your Telerik points.

Please make sure that you cast your vote for it. The more votes an item gathers, the higher its priority becomes.

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

0
fazera
Top achievements
Rank 1
answered on 21 Jul 2020, 07:42 AM
Thank you, Dess.
Tags
ImageEditor
Asked by
fazera
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
fazera
Top achievements
Rank 1
Share this question
or