16,554
社区成员
发帖
与我相关
我的任务
分享
'填充PictureBox1渐变色的代码
Private Sub PictureBox1_Paint(sender As Object, e As PaintEventArgs) Handles PictureBox1.Paint
Dim c1, c2 As Color
c1 = Color.FromArgb(255, 255, 0, 0)
c2 = Color.FromArgb(255, 255, 255, 0)
Using LG As Drawing2D.LinearGradientBrush = New Drawing2D.LinearGradientBrush(New Point(0, 0), New Point(PictureBox1.Width, 0), c1, c2)
e.Graphics.FillRectangle(LG, New Rectangle(0, 0, PictureBox1.Width, PictureBox1.Height))
End Using
End Sub