Locator+ Code:   
Search:   
FTPOnline
Magazines Resources Hot Topics Partner Sites About FTP RSS 2.0 Feed



email article
printer friendly
get the code
more resources

Draw Asynchronously With .NET
Use a background thread and GDI+ to render an image progressively—and efficiently.
by Bill Storage

Technology Toolbox: VB.NET, C#, GDI+

Figure 1. Use Background Threads for More Efficiency.
.NET's GDI+ and multithreading capabilities make short work of performing background graphics operations. The need for rendering charts, graphs, and custom maps progressively is fairly common, yet it's been out of the reach of many RAD environments. For example, graphics rendering on a background thread was nearly impossible in pre-.NET VB. The only means of asynchronous processing available was with a timer. My article, "Designing for OLE Automation," demonstrated this approach, using Lyapunov space plots as a demo project (see Resources). After addressing various problems with timers, such as inefficiencies resulting from guessing how often client and server objects needed to yield (see Figure 1), I concluded that free threading would make the whole thing easier.

In fact it does, and this article is partly a reply to e-mail I've received from longtime VSM readers asking for a free-threaded update of the Lyapunov calculator. Lyapunov space is a plot of stability of dynamic systems seen in the classic logistics equation x = rx(1-x), applying a periodic forcing function to the constant r.

Back to top












Java Pro | Visual Studio Magazine | Windows Server System Magazine
.NET Magazine | Enterprise Architect | XML & Web Services Magazine
| | Discussions | Newsletters | FTP Home