Home » U++ Library support » Draw, Display, Images, Bitmaps, Icons » Drawing performance issue
Drawing performance issue [message #43147] |
Mon, 19 May 2014 10:01  |
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
|
|
|
Goto Forum:
Current Time: Sun May 11 20:35:14 CEST 2025
Total time taken to generate the page: 0.03176 seconds
|