|
-
Feb 8th, 2003, 07:48 PM
#1
Thread Starter
Addicted Member
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?
-
Feb 8th, 2003, 09:51 PM
#2
PowerPoster
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
-
Feb 9th, 2003, 11:26 AM
#3
Member
Dim g As Graphics = Me.CreateGraphics
g.DrawLine(Pens.Black, 0, 20, 100, 20)
g.Dispose()
-
Feb 9th, 2003, 07:25 PM
#4
Lively Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|