Graphics Reference
In-Depth Information
Application coordinate system
Hand template in its original shape/size
e s yst
yst e em
Hand template in its original shape/size
App
App lic
lic ati
ati o on coo
coo rdi
rdi nat
nat es
H
x
Scale transform
x by 1. 7 /
x
Scale transform
x by 1.7 / y by 0.7
y by 0.7
Purpose:
Modeling
y
Rotate transform
clockwise 45 degrees
f
Magniied
view
Application coordinate system
Instance “remodeled” into 7:30 hour hand
H
Scale transform
by 4.8 on both axes
Scale transform
b y 4.8 on both axes
Purpose:
Display
Translate transform
x :
Translate transform
x :
1
48
y :
y :
1
48
48
48
1
1
WPF canvas coordinate system
WPF canvas coordinate system
Figure 2.21: Final result of modeling transform that constructs an hour hand at the 7:30
position.
minute hand) through the display-transformation sequence. The result is the full
clock image, depicting the time of 7:30. Note that this chapter's online resources
include an animation showing the complete operation of this sequence of model-
ing and display transformations.
Inline Exercise 2.4: To ensure your complete understanding of how we've
built the entire static clock scene, launch an XAML development environment
and start with just a blank canvas. Add all the XAML code necessary to build
a clock scene showing the time of 1:45. Add a 12:00 dot if you wish.
Inline Exercise 2.5: When using the WPF canvas in the recommended manner
( ClipToBounds=“True” ), visual information that would lie outside the canvas's
bounds is hidden; that is, the image is “clipped” to the canvas boundary.
(a) To see what happens when the canvas is too small to show the entire clock
image, use your window manager to radically reduce the size of the window in
which the lab software runs.
(b) Jump ahead to read Section 2.6, which describes a couple of the ways
a full-featured application might adapt to situations in which the canvas is
forced to be too small to show the entire scene. Think about how an application
could use WPF display transformations to implement either the zoom-out or
the pan/scroll solutions presented in that section.
Inline Exercise 2.6: Construct a thin, red-colored second hand by creating a
new resource template with its own distinct polygonal shape. Instantiate it on
top of your solution to Inline Exercise 2.4 to test your work. Our solution is in
the lab (V.06).
 
Search WWH ::




Custom Search