【发布时间】:2010-05-15 16:52:32
【问题描述】:
是否有办法改变 GraphicsPath 对象中某些点的坐标,而将其他点留在原处?
传入我的方法的 GraphicsPath 对象将包含多边形和线条的混合。我的方法看起来像:
void UpdateGraphicsPath(GraphicsPath gPath, RectangleF regionToBeChanged, PointF delta)
{
// Find the points in gPath that are inside regionToBeChanged
// and move them by delta.
// gPath.PathPoints[i].X += delta.X; // Compiles but doesn't work
}
GraphicsPath.PathPoints 似乎是只读的,GraphicsPath.PathData.Points 也是如此。所以我想知道这是否可能。
也许用一组更新的点生成一个新的 GraphicsPath 对象?如何知道一个点是直线还是多边形的一部分?
如果有人有任何建议,我将不胜感激。
【问题讨论】: