Click or drag to resize
CanvasDpiRounding Enumeration
Specifies the rounding behavior while performing dips-to-pixels conversions.

Namespace:  Microsoft.Graphics.Canvas
Assembly:  Microsoft.Graphics.Canvas (in Microsoft.Graphics.Canvas.dll) Version:
public enum CanvasDpiRounding
  Member nameValueDescription
Floor0Fractional amounts are rounded downward, toward negative infinity.
Round1Fractional amounts are rounded to the nearest whole integer.
Ceiling2Fractional amounts are rounded upward, toward positive infinity.

After applying DPI scaling to a quantity in dips, this rounding scheme is applied immediately before conversion to an integer. The various implementations of ConvertDipsToPixels(Single, CanvasDpiRounding) return pixels in integral quantities.

The Floor option will yield which location in a pixel grid covers the point specified by the dips value. This is useful for things like converting pointer input to pixel cells in a paint program.

The Round option will round to the closest representable pixel value. This is useful for things like converting the sizes of bitmap resources.

See Also