本文整理汇总了C#中GraphicsPath.AddPath方法的典型用法代码示例。如果您正苦于以下问题:C# GraphicsPath.AddPath方法的具体用法?C# GraphicsPath.AddPath怎么用?C# GraphicsPath.AddPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GraphicsPath
的用法示例。
在下文中一共展示了GraphicsPath.AddPath方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RandomWarp
public GraphicsPath RandomWarp(GraphicsPath path)
{
// Add line //
int PsCount = 10;
PointF[] curvePs = new PointF[PsCount * 2];
for (int u = 0; u < PsCount; u++)
{
curvePs[u].X = u * (Width / PsCount);
curvePs[u].Y = Height / 2;
}
for (int u = PsCount; u < (PsCount * 2); u++)
{
curvePs[u].X = (u - PsCount) * (Width / PsCount);
curvePs[u].Y = Height / 2 + 2;
}
double eps = Height * 0.05;
double amp = rnd.NextDouble() * (double)(Height / 3);
double size = rnd.NextDouble() * (double)(Width / 4) + Width / 8;
double offset = (double)(Height / 3);
PointF[] pn = new PointF[path.PointCount];
byte[] pt = new byte[path.PointCount];
GraphicsPath np2 = new GraphicsPath();
GraphicsPathIterator iter = new GraphicsPathIterator(path);
for (int i = 0; i < iter.SubpathCount; i++)
{
GraphicsPath sp = new GraphicsPath();
bool closed;
iter.NextSubpath(sp, out closed);
Matrix m = new Matrix();
m.RotateAt(Convert.ToSingle(rnd.NextDouble() * 30 - 15), sp.PathPoints[0]);
m.Translate(-1 * i, 0);//uncomment
sp.Transform(m);
np2.AddPath(sp, true);
}
for (int i = 0; i < np2.PointCount; i++)
{
//pn[i] = Noise( path.PathPoints[i] , eps);
pn[i] = Wave(np2.PathPoints[i], amp, size);
pt[i] = np2.PathTypes[i];
}
GraphicsPath newpath = new GraphicsPath(pn, pt);
return newpath;
}