Results 1 to 9 of 9
  1. #1
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow

    [Help] Deleting drawn graphics

    Hey guys, I'm using this code to draw an ellipse at the point the cursor is currently at.

    [php]
    Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove

    Dim myGraphics As Graphics


    myGraphics = Graphics.FromHwnd(ActiveForm().Handle)

    myGraphics.DrawEllipse(pen:=New Pen(Color.Green), _
    rect:=New Rectangle(x:=(e.X - 35), y:=(e.Y - 35), Width:=70, Height:=70))

    myGraphics.Dispose()


    End Sub
    [/php]

    However, I need it to first delete the previously drawn graphic from the form before drawing then next one as this is the effect im currently getting.



    But what I want is just for a circle to follow the pointer wherever it goes.

    Help?

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  2. #2
    'Bruno's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Portugal
    Posts
    2,883
    Reputation
    290
    Thanks
    1,036
    My Mood
    Busy
    i guess you can just clear the whole form.

    (Event mouse move)
    Clear all (xx.Clear(color) if not wrong..)
    Draw new circle

    Code:
    Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove
    
            Dim myGraphics As Graphics
    
    
            myGraphics = Graphics.FromHwnd(ActiveForm().Handle)
    
            myGraphics.Clear(Color.Green)
    
            myGraphics.DrawEllipse(pen:=New Pen(Color.Green), _
            rect:=New Rectangle(x:=(e.X - 35), y:=(e.Y - 35), Width:=70, Height:=70))
    
            myGraphics.Dispose()
    
    
        End Sub
    like this or so.. not quite sure since i dont code in Vb.
    Last edited by 'Bruno; 05-27-2010 at 11:28 AM.
    Light travels faster than sound. That's why most people seem bright until you hear them speak.

  3. The Following User Says Thank You to 'Bruno For This Useful Post:

    Jason (05-27-2010)

  4. #3
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    That just makes the form go completely green O.o

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  5. #4
    'Bruno's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Portugal
    Posts
    2,883
    Reputation
    290
    Thanks
    1,036
    My Mood
    Busy
    Quote Originally Posted by J-Deezy View Post
    That just makes the form go completely green O.o
    ups.. Color.White (form color) <.< or W/e ur form color is.
    Light travels faster than sound. That's why most people seem bright until you hear them speak.

  6. #5
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Quote Originally Posted by Brinuz View Post
    ups.. Color.White (form color) <.< or W/e ur form color is.
    Brilliant, thanks a lot (i used "Me.BackColor")

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  7. #6
    'Bruno's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Portugal
    Posts
    2,883
    Reputation
    290
    Thanks
    1,036
    My Mood
    Busy
    Quote Originally Posted by J-Deezy View Post
    Brilliant, thanks a lot (i used "Me.BackColor")
    even better p
    Light travels faster than sound. That's why most people seem bright until you hear them speak.

  8. #7
    ViittO's Avatar
    Join Date
    Feb 2010
    Gender
    male
    Posts
    168
    Reputation
    10
    Thanks
    25
    My Mood
    Psychedelic
    why you have it on mouse move??
    change it to mouse down and mouse up

  9. #8
    'Bruno's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Portugal
    Posts
    2,883
    Reputation
    290
    Thanks
    1,036
    My Mood
    Busy
    Quote Originally Posted by ViittO View Post
    why you have it on mouse move??
    change it to mouse down and mouse up
    what the hell.. dude. maybe because he doesnt want an event click? he just want it to get it draw around his mouse.
    Light travels faster than sound. That's why most people seem bright until you hear them speak.

  10. #9
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Quote Originally Posted by Brinuz View Post
    what the hell.. dude. maybe because he doesnt want an event click? he just want it to get it draw around his mouse.
    Exactly. I'm doing a basic shooting game so I need to draw the crosshair at cursor as it moves.

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

Similar Threads

  1. [Help]Delete Copies
    By HalfBajan in forum Visual Basic Programming
    Replies: 10
    Last Post: 01-27-2011, 03:02 AM
  2. [Help] Deleting files permanently[Solved]
    By nathanael890 in forum Visual Basic Programming
    Replies: 9
    Last Post: 01-21-2011, 05:58 AM
  3. [Help]deleting / replacing
    By /b/oss in forum Visual Basic Programming
    Replies: 15
    Last Post: 10-11-2010, 02:47 AM
  4. [help]Deleting first 2 charecters DWORD
    By lauwy in forum C++/C Programming
    Replies: 6
    Last Post: 08-28-2010, 06:23 AM
  5. help with ram/graphics
    By owenh1 in forum General
    Replies: 17
    Last Post: 12-06-2009, 10:44 AM