6 Answers, 1 is accepted
Hello, Saeed,
Currently, RadPictureBox doesn't support zoom to cursor functionality. You can also have a look at the support formats: https://docs.telerik.com/devtools/winforms/controls/picturebox/overview#supported-formats
However, it sounds like a reasonable request. I have logged it in our feedback portal by creating a public thread 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.
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
Тhe web is about to get a bit better!
The Progress Hack-For-Good Challenge has started. Learn how to enter and make the web a worthier place: https://progress-worthyweb.devpost.com.
Thanks for reply.
The format is not an issue, same behavior is for jpg or png
Hello, Saeed,
I have tested zooming a .jpg image in RadPictureBox. I haven't noticed anything specific in the scrollbars. Please refer to the attached gif file for better illustration. Am I missing something? Could you please specify the exact steps how to reproduce the problem you are facing?
I have also attached my sample project for your reference. Please give it a try and see how it works on your end.
Once we replicate the issue locally, we can make an adequate analysis o the precise case and provide further assistance.
Thank you in advance for your cooperation. I am looking forward to your reply.
Regards,
Dess | Tech Support Engineer, Sr.
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.
Hi.
The scrolling happening during zooming , when the scroll bars , for example, in the middle of the control.
Can't attach it here , the file is too big.
https://youtu.be/oh03NHdm3NI
any way, to reproduce follow the steps:
1. Zoom in using mouse wheel (quite a lot, not just a few clicks) - Scroll bars are expected to remain in position , about 0 pos.
2. move scroll bars to the middle.
3. Zoom in again using mouse wheel
Scroll bars will jump to the maximum position
4. try to move them back to the middle and zoom in again
Again , Scroll bars will jump to the max position
Thank you for the provided sample video illustrating the problem you are facing. I would like to note that this is related to the previously logged item for implementing ZoomToCursor functionality which currently is not supported: https://feedback.telerik.com/winforms/1516572-radpicturebox-add-zoomtocursor-functionality
Currently, the possible solution that I can suggest is to store the ratio of the vertical scrollbar's offset and adjust the value when you zoom the picture:
public RadForm1()
{
InitializeComponent();
this.radPictureBox1.ZoomChanged += RadPictureBox1_ZoomChanged;
this.radPictureBox1.PictureBoxElement.MouseWheel += RadPictureBox1_MouseWheel;
}
float fraction = 0;
private void RadPictureBox1_MouseWheel(object sender, MouseEventArgs e)
{
fraction = (float)this.radPictureBox1.PictureBoxElement.VerticalScrollBar.Value /
(this.radPictureBox1.PictureBoxElement.VerticalScrollBar.Maximum -
this.radPictureBox1.PictureBoxElement.VerticalScrollBar.LargeChange);
}
private void RadPictureBox1_ZoomChanged(object sender, EventArgs e)
{
if (fraction!=0)
{
this.radPictureBox1.PictureBoxElement.VerticalScrollBar.Value =
(int)((this.radPictureBox1.PictureBoxElement.VerticalScrollBar.Maximum -
this.radPictureBox1.PictureBoxElement.VerticalScrollBar.LargeChange) * fraction);
}
}
The attached gif file illustrates the achieved result.
Should you have further questions please let me know.
Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.