Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I'm trying to figure out how to get GDI+ to get to higher FPS. Right now it's only going around 8-11 on a good day. I am coding in Visual Basic .NET if that could be the problem for the speed (I only own it and C++ .NET and I have yet to learn Managed C++) This is how I normally do my GDI+ drawing:

 


   Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

       Dim start, count, curr As Integer

       start = Environment.TickCount

       Me.Show()

       Do
           curr = Environment.TickCount

           pbx.Invalidate()
           Application.DoEvents()

           If start <= curr - 1000 Then
               start = Environment.TickCount
               Console.WriteLine(count)
               count = 0
           Else
               count += 1
           End If
       Loop
   End Sub

 

Any tips?

  • 2 weeks later...
Posted
GDI+ is generally slower because it operates like Direct3D's 2D functions[it does Rotation, AlphaBlending, Scaling, etc] but doesn't use Hardware acceleration, so it is very slow. In Windows Longhorn, GDI+ will hopefully be linked into Avalon(New graphics engine, replacement of GDI, it's based on Direct3D) but until then GDI+ has a low framerate so drawing only when necessary(or at least only the parts that change) will increase your framerate reasonably otherwise use the drawing APIs in GDI32.DLL
.Net allows software to be written for any version of Windows and not break like Unmanaged applications unless using Unmanaged procedures like APIs. If your program uses large amounts of memory but releases it when something else needs it, then what's the problem?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...