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


C# EllipseGeometry.Freeze方法代码示例

本文整理汇总了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];
 }
开发者ID:sangelov,项目名称:Gabriel-Graph,代码行数:18,代码来源:DelaunayTriangulation.cs

示例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];
        }
开发者ID:sangelov,项目名称:Gabriel-Graph,代码行数:21,代码来源:GabrielGraph.cs

示例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);
                });

        }
开发者ID:JoeyEremondi,项目名称:tikzedt,代码行数:22,代码来源:RasterControl.xaml.cs


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