Esempio n. 1
0
 /// <summary>
 /// Converts a <see cref="Rect"/> to device pixels using the specified dots per inch (DPI).
 /// </summary>
 /// <param name="rect">The rect.</param>
 /// <param name="dpi">The dots per inch of the device.</param>
 /// <returns>The device-independent point.</returns>
 public static PixelRect FromRectWithDpi(Rect rect, Vector dpi) => new PixelRect(
     PixelPoint.FromPointWithDpi(rect.Position, dpi),
     PixelSize.FromSizeWithDpi(rect.Size, dpi));
Esempio n. 2
0
 /// <summary>
 /// Converts a <see cref="Rect"/> to device pixels using the specified dots per inch (DPI).
 /// </summary>
 /// <param name="rect">The rect.</param>
 /// <param name="dpi">The dots per inch of the device.</param>
 /// <returns>The device-independent point.</returns>
 public static PixelRect FromRectWithDpi(Rect rect, Vector dpi) => new PixelRect(
     PixelPoint.FromPointWithDpi(rect.Position, dpi),
     FromPointCeiling(rect.BottomRight, dpi / 96));