Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » Draw, Display, Images, Bitmaps, Icons » Drawing performance issue
Drawing performance issue [message #43147] Mon, 19 May 2014 10:01 Go to previous message
crydev is currently offline  crydev
Messages: 151
Registered: October 2012
Location: Netherlands
Experienced Member
Hello,

I am having some trouble with drawing a big amount of lines on a panel. The drawing takes very long. I know this is not strange because the amount of lines is very high, but I was wondering if I could speed it up. Drawing 3 to 12 million lines takes 5 to 20 seconds. The following is the drawing code.

void KochPanel::Paint(Draw& draw)
{
	const Size sz = this->GetSize();
	const int cx = sz.cx;
	const int cy = sz.cy;
	
    draw.DrawRect(0, 0, cx, cy, Black);
    
    if (!kochFractal->IsRunningCalculation())
    {
	    for (int i = 0; i < kochFractal->GetNumberOfEdges(); ++i)
	    {
	        const Edge& e = (*kochFractal)[i];
	        draw.DrawLine((int)e.X1, (int)e.Y1, (int)e.X2, (int)e.Y2, 1, Color::FromRaw(e.Color));
	    }        
    }
}


Thanks in advance!

crydev
 
Read Message
Read Message
Previous Topic: How to create animated GIFs?
Next Topic: Should RGBA have got 4 arguments constructor?
Goto Forum:
  


Current Time: Fri Apr 26 09:11:01 CEST 2024

Total time taken to generate the page: 0.05810 seconds