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


C# Point.ToMap方法代码示例

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


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

示例1: ReadColor

 private void ReadColor(Point p)
 {
     if (Target != null && ColorHolder != null && Target.IsReady)
     {
         ColorHolder.CurrColor = Target.ReadPixel(p.ToMap(Target.GridWidth));
     }
 }
开发者ID:xxy1991,项目名称:cozy,代码行数:7,代码来源:PixelStraw.cs

示例2: OnMove

 protected override void OnMove(Point p)
 {
     base.OnMove(p);
     if (Target != null && Target.IsReady)
     {
         DrawPoints.Add(p.ToMap(Target.GridWidth));
     }
 }
开发者ID:xxy1991,项目名称:cozy,代码行数:8,代码来源:DragPixelTool.cs

示例3: OnEnd

 protected override bool OnEnd(Point p)
 {
     base.OnEnd(p);
     if (Target != null && Target.IsReady)
     {
         DrawPoints.Add(p.ToMap(Target.GridWidth));
     }
     return false;
 }
开发者ID:xxy1991,项目名称:cozy,代码行数:9,代码来源:DragPixelTool.cs

示例4: OnBegin

        protected override void OnBegin(Point p)
        {
            base.OnBegin(p);

            if(Target != null && Target.IsReady)
            {
                BeginPoint = p.ToMap(Target.GridWidth);
            }
        }
开发者ID:xxy1991,项目名称:cozy,代码行数:9,代码来源:PixelLine.cs

示例5: GetPath

 static IEnumerable<Point> GetPath(int startX, int startY, double dx, double dy)
 {
     var geo = new Point(startX, startY).ToGeometry();
     var deltaPoint = new PointF((float)dx, (float)dy);
     while (true)
     {
         geo = geo.Add(deltaPoint);
         yield return geo.ToMap();
     }
 }
开发者ID:xoposhiy,项目名称:icfpc2015,代码行数:10,代码来源:LineSlots.cs

示例6: OnBegin

        protected override void OnBegin(Point p)
        {
            base.OnBegin(p);

            if (Target.IsReady)
            {
                LastPoint = p.ToMap(Target.GridWidth);
                DrawPoints.Add(LastPoint);
            }
        }
开发者ID:xxy1991,项目名称:cozy,代码行数:10,代码来源:DragPixelTool.cs

示例7: OnMove

        protected override void OnMove(Point p)
        {
            base.OnMove(p);

            if(Target != null && ColorHolder != null && Target.IsReady)
            {
                Target.UpdateDrawable();
                var points = new Dictionary<Point, Color>();
                GenericDraw.Line(BeginPoint, p.ToMap(Target.GridWidth), ColorHolder.CurrColor, points);
                Target.FakeDrawPixel(points.GetDistributionColor(Target, Width));
            }
        }
开发者ID:xxy1991,项目名称:cozy,代码行数:12,代码来源:PixelLine.cs

示例8: OnMove

        protected override void OnMove(Point p)
        {
            base.OnMove(p);

            if (Target != null && ColorHolder != null && Target.IsReady)
            {
                var old_last    = LastPoint;
                LastPoint       = p.ToMap(Target.GridWidth);

                GenericDraw.Line(old_last, LastPoint, ColorHolder.CurrColor, FakeDrawPoints);
                Target.FakeDrawPixel(FakeDrawPoints.GetDistributionColor(Target, Width));
            }
        }
开发者ID:xxy1991,项目名称:cozy,代码行数:13,代码来源:PixelPencil.cs

示例9: OnEnd

        protected override bool OnEnd(Point p)
        {
            base.OnEnd(p);

            if (Target != null && ColorHolder != null && Target.IsReady)
            {
                var points = new Dictionary<Point, Color>();
                GenericDraw.Line(BeginPoint, p.ToMap(Target.GridWidth), ColorHolder.CurrColor, points);
                var command = new DrawPixelCommand()
                {
                    Points  = points.GetDistributionColor(Target, Width),
                    Target  = Target,
                };
                CommandManager.Instance.Do(command);

                Target.UpdateDrawable();
                return true;
            }
            return false;
        }
开发者ID:xxy1991,项目名称:cozy,代码行数:20,代码来源:PixelLine.cs

示例10: OnEnd

        protected override bool OnEnd(Point p)
        {
            base.OnEnd(p);

            if (Target != null && ColorHolder != null && Target.IsReady)
            {
                var mapp    = p.ToMap(Target.GridWidth);
                var points  = GenericDraw.GetPointsWithSameColor(Target, mapp, Target.ReadPixel(mapp));

                var command = new DrawPixelCommand()
                {
                    Points  = points.Select(x => new KeyValuePair<Point, Color>(x.Key, ColorHolder.CurrColor)),
                    Target  = Target,
                };
                CommandManager.Instance.Do(command);

                Target.UpdateDrawable();
                return true;
            }
            return false;
        }
开发者ID:xxy1991,项目名称:cozy,代码行数:21,代码来源:PixelFill.cs


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