Results 1 to 9 of 9
  1. #1
    TheRealOne's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Portugal
    Posts
    36
    Reputation
    15
    Thanks
    7
    My Mood
    Cold

    [help] - hi, some help in a "graph" [Solved]

    HI,
    I've been away from programing and MPGH for a while now... But now I'm back xD

    And I need some help...

    I I'm trying to make a program the "draws" the stuff that I input... Like I want it to make a line somewhere, I insert the coordinates and it draws the line...

    I don't know if any of you know what descriptive geometry is but its something like that...
    You have x,y and z... lets say, the coordinates (1,2,3) are X=1 Y=2 and Z=3... (just like that stuff that you learn in maths in the 10th grade)

    I don't know if I'm making myself clear.... so heres a picture of what I'm trying to know how to do:



    I insert the data ( in this case 2;4;2) and it draws the points.... (yes, I have a "form" with the place to insert the data, all I have to do its to acctualy "work" xP)

    PS: I know how to had lines, But I want to know how to had dots and unite two dots and stuff like that...

    Ty,
    TheRealOne
    Last edited by TheRealOne; 01-25-2011 at 07:27 AM.
    Learning VB and C


    Objectives:
    1 Post
    2 Posts
    10 Posts
    50 Posts
    100 Posts
    Making a Tuturial
    Make a tool (and releasing it)
    Making my own set of tools (and release it)
    [IMG]https://i111.photobucke*****m/albums/n121/golmor/learntoprogram-1.png[/IMG]

  2. #2
    'Bruno's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Portugal
    Posts
    2,883
    Reputation
    290
    Thanks
    1,036
    My Mood
    Busy
    So.. what's the problem? Using drawline is quite easy.

    Graphics Class (System.Drawing)

    PS: I know how to had lines, But I want to know how to had dots and unite two dots and stuff like that...
    Simple.. DrawEllipse with fill.. What's so hard.. Check the link i gave you

    It's all based on Pixels.. Should be simple..
    Last edited by 'Bruno; 01-25-2011 at 07:29 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:

    TheRealOne (01-28-2011)

  4. #3
    TheRealOne's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Portugal
    Posts
    36
    Reputation
    15
    Thanks
    7
    My Mood
    Cold
    Hum... Didn't know that that existed... (I fell bumb -.-''... stupid question...) I'll see how to work with that and try to do what I want... Ty... I probably won't be back on the pc today, so I'll only post again tomorrow...

    ty and sry -.-''
    Learning VB and C


    Objectives:
    1 Post
    2 Posts
    10 Posts
    50 Posts
    100 Posts
    Making a Tuturial
    Make a tool (and releasing it)
    Making my own set of tools (and release it)
    [IMG]https://i111.photobucke*****m/albums/n121/golmor/learntoprogram-1.png[/IMG]

  5. #4
    TheRealOne's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Portugal
    Posts
    36
    Reputation
    15
    Thanks
    7
    My Mood
    Cold
    hi again....
    I have a doubt... Can you give me an example of how to use the draw line comand?
    I have this:
    Code:
    Public Sub DrawLinesPoint(ByVal e As PaintEventArgs)
    
        ' Create pen.
        Dim blackPen As New Pen(Color.Black, 3)
    
        ' Create array of points that define lines to draw.
        Dim points As Point() = {New Point(10, 10), New Point(10, 100), _
        New Point(200, 50), New Point(250, 300)}
    
        'Draw lines to screen.
        e.Graphics.DrawLines(blackPen, points)
    End Sub
    But it says that it doesn't recognise "Graphics" as a PaintEventArgs.... can you help me on that? ty... (this is exacly what was on microsoft page...(msdn)... I think that this should be really easy to fix, but for some reason I don't know how to do it...


    Thank you
    Learning VB and C


    Objectives:
    1 Post
    2 Posts
    10 Posts
    50 Posts
    100 Posts
    Making a Tuturial
    Make a tool (and releasing it)
    Making my own set of tools (and release it)
    [IMG]https://i111.photobucke*****m/albums/n121/golmor/learntoprogram-1.png[/IMG]

  6. #5
    master131's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    Melbourne, Australia
    Posts
    8,858
    Reputation
    3438
    Thanks
    101,677
    My Mood
    Breezy
    On the form's Paint event, try putting this there:
    Code:
    Call DrawLinesPoint(e)
    Result from your code:


    If you want to have a cartesian plane like in your drawing the the first post, you have to do something like this:
    Code:
    Dim centerX As Integer = Me.Width / 2
    Dim centerY As Integer = Me.Height / 2
    Dim points as Point() { New Point(centerX + 5, centerY), New Point(centerX - 5, centerY) }
    Think centerX and centerY as 0 on a cartesian plane.
    centerX + 5 = 0 + 5 = 5.
    centerX + 10 = 0 + 10 = 10.
    centerX - 10 = 0 - 10 = -10.
    Point(centerX - 30, centerY + 20) = (-30, 20)
    Last edited by master131; 01-27-2011 at 08:07 AM.
    Donate:
    BTC: 1GEny3y5tsYfw8E8A45upK6PKVAEcUDNv9


    Handy Tools/Hacks:
    Extreme Injector v3.7.3
    A powerful and advanced injector in a simple GUI.
    Can scramble DLLs on injection making them harder to detect and even make detected hacks work again!

    Minion Since: 13th January 2011
    Moderator Since: 6th May 2011
    Global Moderator Since: 29th April 2012
    Super User/Unknown Since: 23rd July 2013
    'Game Hacking' Team Since: 30th July 2013

    --My Art--
    [Roxas - Pixel Art, WIP]
    [Natsu - Drawn]
    [Natsu - Coloured]


    All drawings are coloured using Photoshop.

    --Gifts--
    [Kyle]

  7. The Following 2 Users Say Thank You to master131 For This Useful Post:

    Blubb1337 (01-27-2011),TheRealOne (01-28-2011)

  8. #6
    TheRealOne's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Portugal
    Posts
    36
    Reputation
    15
    Thanks
    7
    My Mood
    Cold
    Hum... SOmething is going wrong...

    On your first code it sayed:


    [html]Não é possível associar o objecto de tipo 'System.EventArgs' ao tipo 'System.Windows.Forms.PaintEventArgs'.[/html]

    That means that it couldn't associate the object (Call DrawLinesPoint(e)) that is from the type System.EventArgs to the type System.Windows.Forms.PaintEventArgs.... Can you give me an example with the full code plz? thank you... or tell me what I'm doing wrong?

    thanks...

    PS: just if anyone wants to use your second code, I think that (correct me if I'm wrong) your missing the "=" in "Dim points as Point() { New Point(cente..."
    PS: thaks a lot for the second code two... I was thinking in a way to do that xP (As soon as I get the first piece of code working I'll use that one tyvm )
    Learning VB and C


    Objectives:
    1 Post
    2 Posts
    10 Posts
    50 Posts
    100 Posts
    Making a Tuturial
    Make a tool (and releasing it)
    Making my own set of tools (and release it)
    [IMG]https://i111.photobucke*****m/albums/n121/golmor/learntoprogram-1.png[/IMG]

  9. #7
    '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 TheRealOne View Post
    Hum... SOmething is going wrong...

    On your first code it sayed:


    [html]Não é possível associar o objecto de tipo 'System.EventArgs' ao tipo 'System.Windows.Forms.PaintEventArgs'.[/html]

    That means that it couldn't associate the object (Call DrawLinesPoint(e)) that is from the type System.EventArgs to the type System.Windows.Forms.PaintEventArgs.... Can you give me an example with the full code plz? thank you... or tell me what I'm doing wrong?

    thanks...

    PS: just if anyone wants to use your second code, I think that (correct me if I'm wrong) your missing the "=" in "Dim points as Point() { New Point(cente..."
    PS: thaks a lot for the second code two... I was thinking in a way to do that xP (As soon as I get the first piece of code working I'll use that one tyvm )
    Loled @ portuguese error..

    Form or Control paint Event... Which contains PaintEventArgs as param.

    PS: Basicamente, vai aos eventos do form ou do controlo, e cria o evento de paint, usa o e.Graphics dele para fazeres draw, ou enviares para outra funcao... w/e
    Light travels faster than sound. That's why most people seem bright until you hear them speak.

  10. #8
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    It has to be on a Paint event, as Brinuz said. Either override the On_Paint procedure or just handle the Form's Paint event.

    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)

  11. #9
    TheRealOne's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Portugal
    Posts
    36
    Reputation
    15
    Thanks
    7
    My Mood
    Cold
    Quote Originally Posted by Brinuz View Post
    Loled @ portuguese error..

    Form or Control paint Event... Which contains PaintEventArgs as param.

    PS: Basicamente, vai aos eventos do form ou do controlo, e cria o evento de paint, usa o e.Graphics dele para fazeres draw, ou enviares para outra funcao... w/e

    WoW! finally it worked

    Thanks a lot! (all of you)


    PS: lol... Quando explicam em portugues fica mais facil =D Obrigado
    Learning VB and C


    Objectives:
    1 Post
    2 Posts
    10 Posts
    50 Posts
    100 Posts
    Making a Tuturial
    Make a tool (and releasing it)
    Making my own set of tools (and release it)
    [IMG]https://i111.photobucke*****m/albums/n121/golmor/learntoprogram-1.png[/IMG]