drawing a SOLID line if VB.NET

graphics , VB.NET , line drawing Syracuse, United States
  • 10 years ago

    I'm trying to draw a solid line if VB.NET the way I can in VB.

    What I WANT to do is set the pentype to solidcolor, but it says pentype is read only and you have to instantiate the brush as the pen type that you want, SO ... I do this:

    Public myBrush As New SolidBrush(Color.Red)
    Public p1 As New Pen(myBrush, 5)
    

    And what I get when I draw a line is a pen type that is hashed. It's a bit weird, too. The line I'm drawing is between captures of the mouse position and if I move the mouse really fast, I get an almost solid line, but if I move the mouse slowly, I get a hashed line.

    Any ideas what I'm doing wrong?

    Thanks,

    Paul

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Every language has an optimization operator. In C++ that operator is ‘//’”