本文整理汇总了C#中System.Windows.Media.EllipseGeometry.Freeze方法的典型用法代码示例。如果您正苦于以下问题:C# EllipseGeometry.Freeze方法的具体用法?C# EllipseGeometry.Freeze怎么用?C# EllipseGeometry.Freeze使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Media.EllipseGeometry
的用法示例。
在下文中一共展示了EllipseGeometry.Freeze方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetCircumCircle
public Path GetCircumCircle(Polygon polygon)
{
if (!circles.ContainsKey(polygon))
{
Triad triad = triangles[polygon];
EllipseGeometry geometry = new EllipseGeometry();
geometry.Center = new Point(triad.CircumcircleX, triad.CircumcircleY);
geometry.RadiusX = geometry.RadiusY = Math.Sqrt(triad.CircumcircleR2);
geometry.Freeze();
Path path = new Path();
Panel.SetZIndex(path, CircleZIndex);
path.StrokeThickness = CircleStrokeTickness;
path.Stroke = new SolidColorBrush(circleStrokeColor);
path.Data = geometry;
circles[polygon] = path;
}
return circles[polygon];
}
示例2: CreateVertexPoint
public Path CreateVertexPoint(Vertex vertex)
{
if (this.verticesPaths == null)
{
this.verticesPaths = new Dictionary<Vertex, Path>();
}
if (!this.verticesPaths.ContainsKey(vertex))
{
EllipseGeometry geometry = new EllipseGeometry();
geometry.Center = new Point(vertex.X, vertex.Y);
geometry.RadiusX = geometry.RadiusY = VertexRadius;
geometry.Freeze();
Path path = new Path();
path.StrokeThickness = VertexTickness;
path.Stroke = new SolidColorBrush(VertexColor);
path.Data = geometry;
this.verticesPaths[vertex] = path;
}
return this.verticesPaths[vertex];
}
示例3: OnRender
protected override void OnRender(DrawingContext dc)
{
// Draw background
dc.DrawRectangle(Brushes.White, null, new Rect(RenderSize));
Transform t = new MatrixTransform(TheModel.GetTikzToScreenTransform().ToWpfMatrix());
t.Freeze();
Pen pen = new Pen(Brushes.WhiteSmoke, 1);
pen.Freeze();
TheModel.DrawRaster(
(p1, p2) => dc.DrawLine(pen, t.Transform(p1), t.Transform(p2)),
(r1, r2) =>
{
EllipseGeometry eg = new EllipseGeometry(new Point(0, 0), r1, r2);
eg.Transform = t;
eg.Freeze();
dc.DrawGeometry(null, pen, eg);
});
}