Steady Silverlight (7)-2.0 graphics Ellipse,line,path,polygon,polyline,rectangle
Introduced
Silverlight 2.0 Graphics:
Ellipse-Oval
Line-Wire
Path-a series of interconnected lines and curves
Polygon-Polygon, closed graph, beginning and end automatically connected
Polyline-closed graphics, a string of connected lines, starting point and end will not automatically connect
Rectangle-Rectangle
Online Demo
Http://www.cnblogs.com/webabcd/archive/2008/10/09/1307486.html
Example
1, Ellipse.xaml
<UserControl x:Class="Silverlight20.Shape.Ellipse"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<StackPanel HorizontalAlignment="Left">
<!--椭圆-->
<!--
Width - 椭圆的宽
Height - 椭圆的高
Stroke - 边框
StrokeThickness - 边框尺寸
Fill - 填充
-->
<Ellipse Stroke="Red" Fill="Yellow" StrokeThickness="6" Width="100" Height="50"></Ellipse>
</StackPanel>
</UserControl>
2, Line.xaml
<UserControl x:Class="Silverlight20.Shape.Line"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<StackPanel HorizontalAlignment="Left">
<!--线-->
<!--
X1 - 起点的 X 坐标
Y1 - 起点的 Y 坐标
X2 - 终点的 X 坐标
Y2 - 终点的 Y 坐标
注:
Line无填充,也就是Line的Fill属性无效
坐标以左上角为原点,原点右侧/下侧为正方向
-->
<Line X1="0" Y1="100" X2="200" Y2="300" Stroke="Black" StrokeThickness="6" />
</StackPanel>
</UserControl>