Sonnich Jensen
2016-07-07 10:50:40 UTC
Hi all
I have a weird problem - in 10-15% of the time this line crashes, when drawing axis on a graph - the y axis goes well, but the X axis fails at app every 10th
time.
Right now it works with dummy data, which are always within certain limist.
Can anyone suggest why this goes wrong?
Only the second time it fails, the first line never fails.
WBR
Sonnich
// draw axises
bmpGraphics.DrawLine(new Pen(Color.Black), new Point(marginLeft, margin), new Point(marginLeft, bmp.Height - margin));
int ypos = margin + (int)Math.Round((yMax) * ystep);
if (yMax >= 0 && yMin <= 0)
{
// crashes here
bmpGraphics.DrawLine(new Pen(Color.Black), new Point(marginLeft, ypos), new Point(bmp.Width - margin, ypos));
}
I have a weird problem - in 10-15% of the time this line crashes, when drawing axis on a graph - the y axis goes well, but the X axis fails at app every 10th
time.
Right now it works with dummy data, which are always within certain limist.
Can anyone suggest why this goes wrong?
Only the second time it fails, the first line never fails.
WBR
Sonnich
// draw axises
bmpGraphics.DrawLine(new Pen(Color.Black), new Point(marginLeft, margin), new Point(marginLeft, bmp.Height - margin));
int ypos = margin + (int)Math.Round((yMax) * ystep);
if (yMax >= 0 && yMin <= 0)
{
// crashes here
bmpGraphics.DrawLine(new Pen(Color.Black), new Point(marginLeft, ypos), new Point(bmp.Width - margin, ypos));
}