本文整理汇总了C#中Polygon.SetPoint方法的典型用法代码示例。如果您正苦于以下问题:C# Polygon.SetPoint方法的具体用法?C# Polygon.SetPoint怎么用?C# Polygon.SetPoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Polygon
的用法示例。
在下文中一共展示了Polygon.SetPoint方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GrowPolygonByPixels
private void GrowPolygonByPixels(int pixelsOut, float zValue, Polygon newPoly)
{
if (newPoly.Points != null)
{
// These used to always be rectangles, but now they can be irregular shapes because GView can show polys
for (int i = 0; i < newPoly.Points.Count; i++)
{
float oldX = (float)newPoly.Points[i].X;
float oldY = (float)newPoly.Points[i].Y;
float unitsOut;
if (Layer == null)
{
unitsOut = 1 / Camera.Main.PixelsPerUnitAt(zValue);
}
else
{
unitsOut = 1 / Layer.PixelsPerUnitAt(zValue);
}
float xSign = System.Math.Sign(oldX);
float ySign = System.Math.Sign(oldY);
newPoly.SetPoint(i,
oldX + xSign * unitsOut * pixelsOut,
oldY + ySign * unitsOut * pixelsOut);
}
}
}