Completed
Last Updated: 13 Mar 2024 08:49 by ADMIN
Release 2024.1.312
David
Created on: 05 Feb 2024 11:53
Category: PictureBox
Type: Bug Report
0
RadPictureBox: Image is not scaled properly when zooming on 125% monitor scalling
When using the picturebox on a monitor that is not on 100% scaling, the zooming and panning does not work correctly. 
2 comments
David
Posted on: 05 Feb 2024 12:25
Thanks Nadya, Fix worked!!.
ADMIN
Nadya | Tech Support Engineer
Posted on: 05 Feb 2024 12:06

Hello, David,

Thank you for reporting this.

Currently, you can use the following workaround:

publicclass CustomRadPictureBox : RadPictureBox
{
    protected override RadPictureBoxElement CreateImageEditorElement()
    {
        return new CustomPictureBoxElement();
    }

    public override string ThemeClassName
    {
        get { return typeof(RadPictureBox).FullName; }
        set { base.ThemeClassName = value; }
    }
}

public class CustomPictureBoxElement : RadPictureBoxElement
{
    protected override Type ThemeEffectiveType
    {
        get { return typeof(RadPictureBoxElement); }
    }
    protected override PictureBoxCanvasElement CreateCanvasElement()
    {
        return new MyPictureBoxCanvasElement(this);
    }

    public class MyPictureBoxCanvasElement : PictureBoxCanvasElement
    {
        public MyPictureBoxCanvasElement(RadPictureBoxElement owner) : base(owner)
        {
        }

        public override SizeF PositionOffset
        {
            get { return base.PositionOffset; }
            set { base.PositionOffset = TelerikDpiHelper.DescaleSizeF(value, this.DpiScaleFactor); }

        }
    }
}

Regards,
Nadya | Tech Support Engineer
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.

Attached Files: