本文整理汇总了C#中Drawable.GetPoint方法的典型用法代码示例。如果您正苦于以下问题:C# Drawable.GetPoint方法的具体用法?C# Drawable.GetPoint怎么用?C# Drawable.GetPoint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Drawable
的用法示例。
在下文中一共展示了Drawable.GetPoint方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Draw
public void Draw(Graphics g, Drawable d)
{
int pi = 0;
for (int i = 0; i < d.NumDrawables; i++)
{
int drawType = d.DrawableType(i);
if (drawType == Constants.Graphics.DRAW_NOTHING) continue;
int numPts = Constants.Graphics.DRAW_PT_LOOKUP_TABLE[drawType];
Color4 c = d.DrawableColor(i);
pen.Color = Color.FromArgb(c.ToArgb());
for (int j = 0; j < numPts; j++)
p[j] = scale * d.GetPoint(pi++);
switch (drawType)
{
case Constants.Graphics.DRAW_NOTHING:
break;
case Constants.Graphics.DRAW_POINT:
g.DrawRectangle(pen, p[0].X - 1f, p[0].Y - 1f, 2f, 2f);
break;
case Constants.Graphics.DRAW_LINE:
g.DrawLine(pen, p[0].X, p[0].Y, p[1].X, p[1].Y);
break;
case Constants.Graphics.DRAW_CIRCLE:
g.DrawEllipse(pen, p[0].X, p[0].Y, (p[1].X - p[0].X), (p[1].Y - p[0].Y));
break;
}
}
}