Graphics Reference
In-Depth Information
96 units
5
1
0
20
40
60
80
120
160
(0,0)
x
20
40
60
80
100
Canvas width: 168 units 5 1.75 0
y
Figure 2.11: A WPF canvas of size 168
96 units, with ClipToBounds=True . Note the
hardwired location of the origin and the hardwired semantics of 96 units to the physical
inch. On the display device, when rendered by an accurate device driver, this canvas will
appear with a size of 1. 75 × 1 inches. The canvas is bounded on all four sides and displays
only the visual information lying within the bounds.
×
Application
coordinate system
fully under application control; rather, it is performed by a collaboration between
a number of modules: the WPF layout managers (created and configured by the
application to control the location and size of all components in the client area,
including the canvas), the window manager (controlling the location and size of
the application's client area), and the low-level rasterization pipeline (composed
of a sequence of modules such as an immediate-mode package like DirectX or
OpenGL, a low-level device driver, and the graphics hardware itself).
Unbounded
Meaning of
units chosen
by the
application
In the mid-1980s, the standard device-independent unit (DIU) for both Mac
and Windows was 1
WPF canvas
coordinate system
72 of an inch, corresponding to the dpi of typical display
monitors at the time. But research by Microsoft revealed that the typical com-
puter user sits one-third farther away from a display screen than from a printed
page. Thus, to ensure that text rendered at a given point size appears roughly
equivalent on screen and on paper, the DIU for GDI was scaled up by 33% to
96dpi.
Keep in mind that graphics software platforms do not have control over the
accuracy of display hardware, so the DIU is only an approximation. A line of
length 96 units on a WPF canvas will appear to be one inch long on an “ideal
device,” but not necessarily on an actual display screen.
/
Bounded
Each unit
5
1 / 96 of an
inchz
WPF canvas
providing the
viewport
within the
application's
client area
2.4.5 Using Display Transformations
At last, we now understand why our clock face, as defined in our abstract system,
produces the unacceptable result of Figure 2.9.
• The circle has a radius of 20 units. We now know that 20 units on the WPF
canvas is less than 1
Figure 2.12: Progression from an
application's abstract coordinate
system, then into the WPF can-
vas coordinate system, and finally
onto the display device as a part
of the application window's client
area.
4 inch, unacceptably small.
• The circle is specified with its center at the origin. We now know that the
WPF canvas shows only data in the ( + x , + y ) quadrant, so most of our circle
is hidden.
/
 
 
 
Search WWH ::




Custom Search