■ Viewbox 엘리먼트를 사용하는 방법을 보여준다.
▶ 예제 코드 (XAML)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Background="White"> <Viewbox Width="300" Height="300"> <Canvas Width="100" Height="100"> <Ellipse Canvas.Left="5" Canvas.Top="5" Width="90" Height="90" Stroke="Black" /> <Ellipse Canvas.Left="25" Canvas.Top="30" Width="10" Height="10" Stroke="Black" /> <Ellipse Canvas.Left="65" Canvas.Top="30" Width="10" Height="10" Stroke="Black" /> <Polyline Stroke="Black" Points="25 25 30 20 35 25" /> <Polyline Stroke="Black" Points="65 25 70 20 75 25" /> <Polyline Stroke="Black" Points="50 40 45 60 55 60 50 40" /> <Polyline Stroke="Black" Points="25 70 50 80 75 70" /> </Canvas> </Viewbox> </Page> |