#5 – Vector Graphics and Resolution Independence

In WPF, you render things using vector graphics, rather than bitmaps.  This is true both of built-in controls and custom controls that you create.

Instead of coming up with a bitmap pattern that specifies every pixel to be drawn on the screen, you draw elements using basic graphical primitives, e.g. shapes, lines, and polygons.

Because WPF uses vector graphics, user interface elements will be rendered independently from actual device resolution.  The size of graphical elements in WPF is specified using device independent units, where each unit is 1/96th of an inch.  This means that user interface elements will always render at the specified size and not be affected by the pixel density (DPI) of an output device.

Advertisements