[求教] 如何实现图示的角度渐变
vb.net吧
全部回复
仅看楼主
level 1
如图所示的角度渐变如何才能实现,请教各位高手
2015年05月17日 21点05分 1
level 1
贴一下最后用饼图拼接的代码
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim Bmp As New Bitmap(Pic.Width, Pic.Height)
Dim Grp As Graphics = Graphics.FromImage(Bmp)
Dim Path As New GraphicsPath
Dim Rect As New Rectangle(50, 50, 300, 300)
Dim Parts As Integer = 360
Dim i As Integer
Dim Angle As Single = 360 / Parts
Grp.SmoothingMode = SmoothingMode.AntiAlias
For i = 0 To Parts - 1
Path.Reset()
If i < Parts - 1 Then
Path.AddPie(Rect, i * Angle, Angle * 2) '此处sweepAngle应该大于等分角度,否则会有各种美丽的图案呈现
Else
Path.AddPie(Rect, i * Angle, Angle) '终点sweepAngle等于等分角度,否则转过头了就歪了
End If
Grp.FillPath(New SolidBrush(Color.FromArgb(&HFF, 255 - i * 255 / Parts, 255 - i * 255 / Parts, 255 - i * 255 / Parts)), Path)
Next
Pic.Image = Bmp
Grp.Dispose()
End Sub
2015年05月18日 16点05分 3
level 10
楼主啊,这个明显就是画直线做出来的图案。。。
2015年05月19日 05点05分 4
level 12
可以使用bitmapmapdata类极大地加快速度
2015年05月22日 14点05分 7
1