当前位置: 首页>>代码示例>>C#>>正文


C# StreamGeometry.Clone方法代码示例

本文整理汇总了C#中System.Windows.Media.StreamGeometry.Clone方法的典型用法代码示例。如果您正苦于以下问题:C# StreamGeometry.Clone方法的具体用法?C# StreamGeometry.Clone怎么用?C# StreamGeometry.Clone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Media.StreamGeometry的用法示例。


在下文中一共展示了StreamGeometry.Clone方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: EventDataBar

        IEventDataNode hotChunk; // Visual feedback on chunk under the mouse

        public EventDataBar()
        {
            this.Height = 43;
            toolTip.PlacementTarget = this;
            this.Focusable = true;

            this.axisPen = CreateAndBindPen(1, AxisStrokeProperty);
            this.standardPen = CreateAndBindPen(1, StrokeProperty);
            this.selectedPen = CreateAndBindPen(0.5, SelectedStrokeProperty);
            this.highlightedPen = CreateAndBindPen(0.5, HighlightedStrokeProperty);
            this.slicingMarkerPen = new Pen(Brushes.Black, .5);

            selectionArrowGeometry = new StreamGeometry()
            {
                FillRule = FillRule.EvenOdd
            };

            using (StreamGeometryContext ctx = selectionArrowGeometry.Open())
            {
                ctx.BeginFigure(new Point(0, 0), isFilled: true, isClosed: true);
                ctx.LineTo(new Point(3, -6), isStroked: true, isSmoothJoin: false);
                ctx.LineTo(new Point(-3, -6), isStroked: true, isSmoothJoin: false);
            }

            // The hot arrow needs its own geometry because it will have a different transform
            hotArrowGeometry = selectionArrowGeometry.Clone();

            DrawingBrush unattributedBrush = new DrawingBrush();
            GeometryDrawing square = new GeometryDrawing(Brushes.White, null, new RectangleGeometry(new Rect(0, 0, 10, 10)));
            GeometryDrawing line = new GeometryDrawing(null, slicingMarkerPen, new LineGeometry(new Point(0, 0), new Point(10, 10)));

            DrawingGroup drawingGroup = new DrawingGroup();
            drawingGroup.Children.Add(square);
            drawingGroup.Children.Add(line);

            unattributedBrush.Drawing = drawingGroup;
            unattributedBrush.Viewport = new Rect(0, 0, 10, 10);
            unattributedBrush.ViewportUnits = BrushMappingMode.Absolute;
            unattributedBrush.Viewbox = new Rect(0, 0, 10, 10);
            unattributedBrush.ViewboxUnits = BrushMappingMode.Absolute;
            unattributedBrush.TileMode = TileMode.Tile;

            customBrushes[EventColor.UnattributedColor] = unattributedBrush;

            DrawingBrush systemProcessBrush = new DrawingBrush();
            square = new GeometryDrawing(Brushes.Black, null, new RectangleGeometry(new Rect(0, 0, 10, 10)));
            line = new GeometryDrawing(null, new Pen(Brushes.White, 1), new LineGeometry(new Point(0, 0), new Point(10, 10)));

            drawingGroup = new DrawingGroup();
            drawingGroup.Children.Add(square);
            drawingGroup.Children.Add(line);

            systemProcessBrush.Drawing = drawingGroup;
            systemProcessBrush.Viewport = new Rect(0, 0, 10, 10);
            systemProcessBrush.ViewportUnits = BrushMappingMode.Absolute;
            systemProcessBrush.Viewbox = new Rect(0, 0, 10, 10);
            systemProcessBrush.ViewboxUnits = BrushMappingMode.Absolute;
            systemProcessBrush.TileMode = TileMode.Tile;

            customBrushes[EventColor.SystemProcessColor] = systemProcessBrush;
        }
开发者ID:UnaNancyOwen,项目名称:Kinect-Studio-Sample,代码行数:63,代码来源:EventDataBar.cs


注:本文中的System.Windows.Media.StreamGeometry.Clone方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。