MyBase.OnPaint(e)
g = PictureBox3.CreateGraphics
g = e.Graphics
g.Dispose()
Public Class pb Inherits PictureBox Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs) MyBase.OnPaint(e) Cursor.Current = Cursors.WaitCursor Dim g As Graphics Dim i As Integer Dim BluePen As New Pen(Color.Blue, 2) Dim RedPen As New Pen(Color.Red, 2) Dim x0, y0 As Integer x0 = Me.Size.Width / 2 y0 = Me.Size.Height / 2 g = e.Graphics For i = 0 To Delta_uv_ord.Length - 1 g.DrawLine(BluePen, x0, y0, CInt(x0 + Delta_uv_ord(i).up * 200), CInt(y0 + Delta_uv_ord(i).vp * 200)) Next Cursor.Current = Cursors.Default End Sub End Class
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionPublic Class MyPictureBox Inherits PictureBox Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs) MyBase.OnPaint(e) Cursor.Current = Cursors.WaitCursor Dim g As Graphics Dim i As Integer Dim BluePen As New Pen(Color.Blue, 2) Dim RedPen As New Pen(Color.Red, 2) Dim x0, y0 As Integer x0 = PictureBox3.Size.Width / 2 y0 = PictureBox3.Size.Height / 2 g = PictureBox3.CreateGraphics For i = 0 To Delta_uv_ord.Length - 1 g.DrawLine(BluePen, x0, y0, CInt(x0 + Delta_uv_ord(i).up * 200), CInt(y0 + Delta_uv_ord(i).vp * 200)) Next g.Dispose() Cursor.Current = Cursors.Default End Sub End Class