Paul the programmer

I recently upgraded a program I'm working on from VB2003 to VB2005. I allowed the software to do its thing to make my 2003 program compatible with 2005. I had to do some work of my own but not much. I've noticed that some of the graphics is running very noticeably slower. My program is a computer art program that uses DrawLine statements among others. I have an effect that varies the pen width from a certain minimum to whatever I like. All the graphics code is inside of a Timer Tick Sub. On some screens you can see the pen width vary from just 1 or a few pixels up to over 500. This is where it becomes very obvious that the 2005 version of this program is much slower. When the pen width is only a few pixels wide everything is ok but as it widens up to 100s of pixels you can see everything slow down like crazy. The 2003 version might slow down just a tad but the 2005 version slows down a great deal. I tried creating a Release build but didn't notice much difference. Everything is a constant here but the version of VB so it shouldn't have to do with my hardware or whether I'm using XP or what.( I'm using Windows XP Home edition). This section uses Drawline with PointF.

Re: Visual Basic General Program upgraded from 03 to 05. Graphics running much slower.

Bruno Yu - MSFT


Actually there are several reasons that cause the slow implement of the application after upgrade.

1. The compatibility between the two .NET Frameworks. It includes the related methods or classes that commonly use on version 1.1 but not used on .NET 2.0.

2. There are many new classes added on .NET Framework 2.0. Please take a look at the System.Drawing namespace and check the methods and classes you use. Try to use the new added in order to get the new performance.

3. If it is not the case. I recommend you to take a look at the Graphics.DrawLine method with different parameters and the PontF with the sample code in MSDN.