J
Jason
This is a simplified demo of the problem I posted this morning... boiled
down to just the basic case that is causing my app to run painfully slow.
Seems like the slow part is using the graphicsPath Point accessor. Can
anyone see how I could speed this up?
//main test form button handler
private void button1_Click(object sender, System.EventArgs e)
{
System.Drawing.Drawing2D.GraphicsPath gp = new
System.Drawing.Drawing2D.GraphicsPath();
for( int i = 0; i < 2000; i++ )
{
gp.AddLine( i,i, i+2, i );
}
ArrayList list = new ArrayList();
PointF pointF = new PointF( 0,0 );
for ( int i = 0; i < gp.PointCount; i++ )
{
list.Add( gp.PathPoints );
//test.. this is about the speed I would expect
//Point2D p = new Point2D( i,i );
//list.Add( p );
}
int j = 0;//just line so I can put a break point here
}
//---------------------differnt class
class Point2D
{
float m_X, m_Y;
public Point2D( float x, float y )
{
m_X = x;
m_Y = y;
}
public Point2D( PointF p )
{
m_X = p.X;
m_Y = p.Y;
}
}
down to just the basic case that is causing my app to run painfully slow.
Seems like the slow part is using the graphicsPath Point accessor. Can
anyone see how I could speed this up?
//main test form button handler
private void button1_Click(object sender, System.EventArgs e)
{
System.Drawing.Drawing2D.GraphicsPath gp = new
System.Drawing.Drawing2D.GraphicsPath();
for( int i = 0; i < 2000; i++ )
{
gp.AddLine( i,i, i+2, i );
}
ArrayList list = new ArrayList();
PointF pointF = new PointF( 0,0 );
for ( int i = 0; i < gp.PointCount; i++ )
{
list.Add( gp.PathPoints );
//test.. this is about the speed I would expect
//Point2D p = new Point2D( i,i );
//list.Add( p );
}
int j = 0;//just line so I can put a break point here
}
//---------------------differnt class
class Point2D
{
float m_X, m_Y;
public Point2D( float x, float y )
{
m_X = x;
m_Y = y;
}
public Point2D( PointF p )
{
m_X = p.X;
m_Y = p.Y;
}
}