Results 1 to 4 of 4

Thread: drawing a line?

  1. #1

    Thread Starter
    Addicted Member ProgrammerJon's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    203

    drawing a line?

    In visual basic CCE if I wanted to draw a line using code the esiest way was
    Code:
    Me.Line (1, 1)-(100, 100)
    how do I do this in vb.net?

  2. #2
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    Your going to have to get a reference to the forms graphics object, and use that to draw lines and shapes.

    Something like this.....probably not exact though...
    Dim g as Graphics = form1.GetGraphics

  3. #3
    Member
    Join Date
    Dec 2002
    Location
    NY, USA
    Posts
    52
    Dim g As Graphics = Me.CreateGraphics
    g.DrawLine(Pens.Black, 0, 20, 100, 20)
    g.Dispose()
    Iouri Boutchkine

  4. #4
    Lively Member formulav8's Avatar
    Join Date
    Mar 2002
    Location
    Orlando
    Posts
    116
    If you use that method for fast graphics(Ex: Visuals for a music player) you will get lots of flicker. Trust me. I have been through it already. The fastest(To me) and still easy(To me) is to create a bitmap in memory and draw the graphics in memory then apply it to the object. It is very fast and has 0 flicker.


    Jason

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width