Imports System.Drawing.Drawing2D Public Class Form1 Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim pt(3) As Point pt(0) = New Point(0, 0) pt(1) = New Point(100, 20) pt(2) = New Point(100, 80) pt(3) = New Point(0, 100) Dim _region(pt.Length - 1) As Byte For x = 0 To pt.Length - 1 _region(x) = CType(PathPointType.Line, Byte) Next Dim path As New GraphicsPath(pt, _region) PictureBox1.BackColor = Color.Red PictureBox1.Region = New Region(path) End Sub End Class
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question