[VB.NET] Draw FPS

Posts 1–15 of 15 · Page 1 of 1
[VB.NET] Draw FPS
[VB.NET] Draw FPS

You need:

- Form1
- Timer1 (interval 1)
- Timer2 (interval 1)
- Module1
- label1


code for module1
Code:
    ' api declare
    Public Declare Function GetTickCount Lib "kernel32" () As Long

    ' is one sec. ?
    Public FPS_LastCheck As Long

    ' FPS were counted
    Public FPS_Count As Long

    ' here is the actual FPS number
    Public FPS_Current As Integer

    ' highest FPS
    Public FPS_Highest As Integer
Timer1 code:
Code:
If GetTickCount() - FPS_LastCheck >= 1000 Then
            FPS_Current = FPS_Count
            FPS_Count = 0 ' set the counter
            FPS_LastCheck = GetTickCount()

            ' highest FPS
            If FPS_Current > FPS_Highest Then
                FPS_Highest = FPS_Current
            End If
        End If

        FPS_Count = FPS_Count + 1
timer2 code:
Code:
        Dim C1 As Graphics = Graphics.FromHwnd(New IntPtr(FindWindow("CrossFire", "CrossFire")))

        Dim fontObj As Font
        fontObj = New System.Drawing.Font("Times", 25, FontStyle.Bold)

        C1.DrawString("[FPS:" & FPS_Current & "]", fontObj, Brushes.Chocolate, 10, 10)
this is the declare for the draw graphics
Code:
    Private Declare Function InvalidateRect Lib "user32" (ByVal hwnd As IntPtr, ByVal lpRect As IntPtr, ByVal bErase As Boolean) As Boolean

    Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Integer
so should work now youre own draw fps

Credits:
100% and full to Code[VB]
Very nice! Thanks alot... I just made my first spammer, going to do this now.... :P
Still not being a hack

But thanks for sharing.
schick schick
nice tut
stimmt es das du overYou bist/warst ?
Quote Originally Posted by test11 View Post
schick schick
nice tut
stimmt es das du overYou bist/warst ?
Danke
Ja das stimmt
Quote Originally Posted by Code[VB] View Post
Danke
Ja das stimmt
Are u English?
Quote Originally Posted by markO1O8 View Post
Are u English?
no i m german
where's module 1?
Quote Originally Posted by Gku2 View Post
where's module 1?
xD create one ?!
HOW DUDE? thats my ques
Quote Originally Posted by Gku2 View Post
HOW DUDE? thats my ques
lol, i noticed that you dont know anything of Visual Basic /
dude stfu about to rlease my multi tool
Quote Originally Posted by Gku2 View Post
HOW DUDE? thats my ques
u can press right click on your project then Add->New Item...->choose module and pres add hope this is answer on ur question, i dont like noobs who dont answer on question! They just post to have biger post number
Nice I Guess
Posts 1–15 of 15 · Page 1 of 1

Post a Reply

Tags for this Thread

None

Talk with us