コード例 #1
0
ファイル: RootRadElement.cs プロジェクト: RichardHaggard/BDC
 public override void DpiScaleChanged(SizeF scaleFactor)
 {
     if (!RadControl.EnableDpiScaling)
     {
         return;
     }
     this.DpiScaleFactor = TelerikDpiHelper.ScaleSizeF(this.DpiScaleFactor, scaleFactor);
     this.InvalidateMeasure(true);
     base.DpiScaleChanged(this.DpiScaleFactor);
 }
コード例 #2
0
        protected override void ShowPopupCore(Size size, Point location)
        {
            SizeF sizeF1  = this.OwnerElement != null ? this.OwnerElement.DpiScaleFactor : this.dpiScaleFactor;
            bool  isEmpty = this.LastShowDpiScaleFactor.IsEmpty;

            if (this.LastShowDpiScaleFactor != sizeF1)
            {
                if (isEmpty)
                {
                    this.LastShowDpiScaleFactor = new SizeF(1f, 1f);
                }
                SizeF sizeF2 = new SizeF(this.OwnerElement.DpiScaleFactor.Width / this.LastShowDpiScaleFactor.Width, this.OwnerElement.DpiScaleFactor.Height / this.LastShowDpiScaleFactor.Height);
                this.LastShowDpiScaleFactor = sizeF1;
                this.Scale(sizeF2);
                size = TelerikDpiHelper.ScaleSize(size, sizeF2);
            }
            this.SetBoundsCore(location.X, location.Y, size.Width, size.Height, BoundsSpecified.All);
            NativeMethods.ShowWindow(this.Handle, 4);
            if (DWMAPI.IsCompositionEnabled && this.EnableAeroEffects)
            {
                this.UpdateAeroEffectState();
            }
            ControlHelper.BringToFront(this.Handle, false);
        }
コード例 #3
0
 public static RectangleF ScaleRectangleF(RectangleF value, SizeF scaleFactor)
 {
     return(new RectangleF(TelerikDpiHelper.ScalePointF(value.Location, scaleFactor), TelerikDpiHelper.ScaleSizeF(value.Size, scaleFactor)));
 }