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
Re: Drawing performance issue [message #43148 is a reply to message #43147] Mon, 19 May 2014 11:47 Go to previous message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Hi crydev,

Here's few tricks that I deployed successfully in past:

- Don't draw anything that is not visible (out of viewport, overlapped by other shapes).

- Don't draw details that can't be visible on screen. Only use high level of detail when you export images or print.

- Use clever algorithms. Sometimes images can be generated much faster going pixel by pixel than using lines and other drawing primitives.

In your particular case with Koch curve, I think the best would be to apply the second optimization. Only use enough iterations so that length of the line is more than one pixel. If you need the data for some subsequent operations, you could also add conditions to only use point when its distance from last drawn point is more than 1 pixel (or 0.5pixel, it might look better).

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


Current Time: Mon May 06 19:29:21 CEST 2024

Total time taken to generate the page: 0.02546 seconds