public override void DpiScaleChanged(SizeF scaleFactor) { if (!RadControl.EnableDpiScaling) { return; } this.DpiScaleFactor = TelerikDpiHelper.ScaleSizeF(this.DpiScaleFactor, scaleFactor); this.InvalidateMeasure(true); base.DpiScaleChanged(this.DpiScaleFactor); }
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); }
public static RectangleF ScaleRectangleF(RectangleF value, SizeF scaleFactor) { return(new RectangleF(TelerikDpiHelper.ScalePointF(value.Location, scaleFactor), TelerikDpiHelper.ScaleSizeF(value.Size, scaleFactor))); }