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 Rectangle ScaleRectangle(Rectangle value, SizeF scaleFactor) { return(new Rectangle(TelerikDpiHelper.ScalePoint(value.Location, scaleFactor), TelerikDpiHelper.ScaleSize(value.Size, scaleFactor))); }