本文整理汇总了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;
}