Picturebox

  • Thread starter Thread starter David
  • Start date Start date
I'm sure that picture1.Line(5,5)-(5,5) draws a point (or more precisely a
line of one point)

I don't remember if you can use PSet also for pictureboxes, in this way:

picture1.PSet(5,5)

assuming that picture1 is the name of the picturebox and 5,5 are the
coordinates of the point to draw

Bye
 
Sorry, I was thinking in VB6...

In fact this is an interesting question, because in the Graphics class of
the framework I don't see a 'DrawPoint' method.

If I find a solution, I will post in the newsgroup.

Bye
 
David said:
How can I draw a point on the picturebox.

\\\
Private Sub Form1_Paint( _
ByVal sender As Object, _
ByVal e As System.Windows.Forms.PaintEventArgs _
) Handles MyBase.Paint
e.Graphics.FillRectangle( _
Brushes.Red, _
New Rectangle(100, 100, 1, 1) _
)
End Sub
///
 
Hi,

Draw a line with the same start and end points.

Dim g As Graphics = PictureBox1.CreateGraphics
g.DrawLine(Pens.Black, 10, 10, 10, 10)

Ken
 
Ken,
Draw a line with the same start and end points.

Dim g As Graphics = PictureBox1.CreateGraphics
g.DrawLine(Pens.Black, 10, 10, 10, 10)

I am not sure if I am right, but I remember that this filled 2 pixels
instead of one. Did you test it?
 
Back
Top