グラフィック
Shapes
Windows.UI.Xaml.Shapes名前空間のクラス
クラス |
説明 |
Ellipse |
Draws an ellipse. |
Line |
Draws a straight line between two points. |
Path |
Draws a series of connected lines and curves. The line and curve dimensions are declared through the Data property, and can be specified either with a path-specific mini-language, or with an object model. |
Polygon |
Draws a polygon, which is a connected series of lines that form a closed shape. |
Polyline |
Draws a series of connected straight lines. |
Rectangle |
Draws a rectangle shape, which can have a stroke and a fill. |
Shape |
Provides a base class for shape elements, such as Ellipse, Polygon, and Rectangle. |
Windows.UI.Xaml.Shapes Namespace (Windows) | MSDN
Path
LineGeometry
Windows.UI.Xaml.Shapes.Path path = new Windows.UI.Xaml.Shapes.Path();
path.Stroke = new SolidColorBrush(Colors.Black);
path.StrokeThickness = 3;
LineGeometry lineGeometry = new LineGeometry();
lineGeometry.StartPoint = new Point(0, 0);
lineGeometry.EndPoint = new Point(100, 10);
path.Data = lineGeometry;
canvas.Children.Add(path);
EllipseGeometry
Windows.UI.Xaml.Shapes.Path path = new Windows.UI.Xaml.Shapes.Path();
path.Stroke = new SolidColorBrush(Colors.Black);
EllipseGeometry ellipseGeometry = new EllipseGeometry();
ellipseGeometry.RadiusX = 10;
ellipseGeometry.RadiusY = 10;
ellipseGeometry.Center = new Point(0, 0);
path.Data = ellipseGeometry;
canvas.Children.Add(path);