After executing program it gets directly out side of project. I don't know why it happens.
for (int i = 1; i != POINTS_ON_CURVE-1; i += 2)
{
g.DrawRectangle(newpx, new Rectangle((int)p[i + 1], (int)p[i], 1, 1));
g.Flush();
Application.DoEvents();
}
After executing it gets off.
Plz help me.
Added from comment below:
ptList.Add(162);
ptList.Add(127);
ptList.Add(204);
ptList.Add(124);
ptList.Add(304);
ptList.Add(207);
const int POINTS_ON_CURVE = 1000;
double[] ptind = new double[ptList.Count];
double[] p = new double[POINTS_ON_CURVE];
ptList.CopyTo(ptind, 0);
bc.Bezier2D(ptind, (POINTS_ON_CURVE) / 2, p);
for (int i = 1; i != POINTS_ON_CURVE - 1; i += 2)
{
g.DrawRectangle(newpx, new Rectangle((int)p[i + 1], (int)p[i], 1, 1));
g.Flush();
Application.DoEvents();
}
it is a program for drawing a curve when i go to execute it executes correctly but after drawing a curve it directly close the window