GDI+ being very slow...

Darc

Well-known member
Joined
Apr 18, 2003
Messages
89
Im trying to figure out how to get GDI+ to get to higher FPS. Right now its 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:

Code:
    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?
 
GDI+ is generally slower because it operates like Direct3Ds 2D functions[It does Rotation, AlphaBlending, Scaling, etc] but doesnt use Hardware acceleration, so it is very slow. In Windows Longhorn, GDI+ will hopefully be linked into Avalon(New graphics engine, replacement of GDI, its 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
 
Back
Top