當前位置: 首頁>>代碼示例>>C#>>正文


C# Point.ToMap方法代碼示例

本文整理匯總了C#中System.Drawing.Point.ToMap方法的典型用法代碼示例。如果您正苦於以下問題:C# Point.ToMap方法的具體用法?C# Point.ToMap怎麽用?C# Point.ToMap使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Drawing.Point的用法示例。


在下文中一共展示了Point.ToMap方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: ReadColor

 private void ReadColor(Point p)
 {
     if (Target != null && Target.IsReady)
     {
         ColorHolder = 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,代碼來源:PixelToolDraggable.cs

示例3: 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

示例4: 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,代碼來源:PixelToolDraggable.cs

示例5: 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,代碼來源:PixelToolDraggable.cs

示例6: 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, points);
                Target.FakeDrawPixel(points.GetDistributionColor(Target, Width));
            }
        }
開發者ID:xxy1991,項目名稱:cozy,代碼行數:12,代碼來源:PixelLine.cs

示例7: OnMove

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

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

                GenericDraw.Line(old_last, LastPoint, Target.DefaultDrawColor, FakeDrawPoints);
                Target.FakeDrawPixel(FakeDrawPoints.GetDistributionColor(Target, Width));
            }
        }
開發者ID:xxy1991,項目名稱:cozy,代碼行數:13,代碼來源:PixelEraser.cs

示例8: 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, 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

示例9: 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)),
                    Target  = Target,
                };
                CommandManager.Instance.Do(command);

                Target.UpdateDrawable();
                return true;
            }
            return false;
        }
開發者ID:xxy1991,項目名稱:cozy,代碼行數:21,代碼來源:PixelFill.cs


注:本文中的System.Drawing.Point.ToMap方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。