StreamGeometryContext 类解析
来源:互联网 发布:泰牛程序员倒闭 编辑:程序博客网 时间:2024/05/22 00:07
使用绘图命令描述几何图形。 此类与 StreamGeometry 类结合使用,以创建不支持数据绑定、动画或修改的轻量几何图形。
using System;using System.Windows;using System.Windows.Controls;using System.Windows.Media;using System.Windows.Shapes;namespace SDKSample{ // Use StreamGeometry with StreamGeometryContext to define a triangle shape. public partial class StreamGeometryTriangleExample : Page { public StreamGeometryTriangleExample() { // Create a path to draw a geometry with. Path myPath = new Path(); myPath.Stroke = Brushes.Black; myPath.StrokeThickness = 1; // Create a StreamGeometry to use to specify myPath. StreamGeometry geometry = new StreamGeometry(); geometry.FillRule = FillRule.EvenOdd; // Open a StreamGeometryContext that can be used to describe this StreamGeometry // object's contents. using (StreamGeometryContext ctx = geometry.Open()) { // Begin the triangle at the point specified. Notice that the shape is set to // be closed so only two lines need to be specified below to make the triangle. ctx.BeginFigure(new Point(10, 100), true /* is filled */, true /* is closed */); // Draw a line to the next specified point. ctx.LineTo(new Point(100, 100), true /* is stroked */, false /* is smooth join */); // Draw another line to the next specified point. ctx.LineTo(new Point(100, 50), true /* is stroked */, false /* is smooth join */); } // Freeze the geometry (make it unmodifiable) // for additional performance benefits. geometry.Freeze(); // Specify the shape (triangle) of the Path using the StreamGeometry. myPath.Data = geometry; // Add path shape to the UI. StackPanel mainPanel = new StackPanel(); mainPanel.Children.Add(myPath); this.Content = mainPanel; } }}
0 0
- StreamGeometryContext 类解析
- 类解析
- XML文件解析工具类pull解析
- Log4j源码解析--核心类解析
- Log4j源码解析--Layout类解析
- jdk工具类____xml解析SAX解析
- jdk工具类____xml解析Dom解析
- 深入解析jvm 类加载器解析
- JAVA JSON解析:类XPATH解析JSON
- 解析HTML的类
- ConfigurationSettings类解析
- 深入解析String类
- 解析xml类
- 解析phpcms数据库连接类
- Java类文件解析
- 解析Array类
- java 解析公式类
- JSON解析类(C#)
- C++中的单例模式
- 我爱这里
- Android listView 梳理
- maven构建spring mvc的helloworld
- 我一定要成为电脑高手
- StreamGeometryContext 类解析
- 电脑运行速度增强建议
- 圣诞设计的网页
- 并发编程系列之一:锁的意义
- 这是我用Qt做的超炫日历
- 转-关于Method类中invoke方法和Class类中getmethod方法的使用
- 修正uboot网络不可用
- VC 编辑框 改变背景、字体、文本颜色、长度限制
- 网线中哪几根真正有用?