本文整理汇总了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));
}
}
示例2: OnMove
protected override void OnMove(Point p)
{
base.OnMove(p);
if (Target != null && Target.IsReady)
{
DrawPoints.Add(p.ToMap(Target.GridWidth));
}
}
示例3: OnEnd
protected override bool OnEnd(Point p)
{
base.OnEnd(p);
if (Target != null && Target.IsReady)
{
DrawPoints.Add(p.ToMap(Target.GridWidth));
}
return false;
}
示例4: OnBegin
protected override void OnBegin(Point p)
{
base.OnBegin(p);
if(Target != null && Target.IsReady)
{
BeginPoint = p.ToMap(Target.GridWidth);
}
}
示例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();
}
}
示例6: OnBegin
protected override void OnBegin(Point p)
{
base.OnBegin(p);
if (Target.IsReady)
{
LastPoint = p.ToMap(Target.GridWidth);
DrawPoints.Add(LastPoint);
}
}
示例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));
}
}
示例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));
}
}
示例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;
}
示例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;
}