求C#语言改VBnet语言
答案:1 悬赏:70 手机版
解决时间 2021-01-09 04:09
- 提问者网友:献世佛
- 2021-01-08 05:31
求C#语言改VBnet语言
最佳答案
- 五星知识达人网友:街头电车
- 2021-01-08 06:35
Public Sub drawTree(ByVal x, ByVal y, ByVal L, ByVal Alf, ByVal n)
Static bm As New Bitmap(PictureBox1.Width, PictureBox1.Height)
Dim G As Graphics = Graphics.FromImage(bm)
Dim i As Int16
Dim aa As Int32 = Alf * Math.PI / 180
Dim x1 As Int32 = x + L * Math.Cos(aa)
Dim y1 As Int32 = y + L * Math.Sin(aa)
Dim pen1 As New Pen(Color.Green)
G.DrawLine(pen1, x, 450 - y, x1, 450 - y1)
PictureBox1.Image = bm
PictureBox1.Refresh()
If (n > 0) Then
For i = 0 To 2
x1 = x + L * tr(0)(i) * Math.Cos(aa)
y1 = y + L * tr(0)(i) * Math.Sin(aa)
drawTree(x1, y1, L * tr(1)(i), Alf + tr(2)(i), n - 1)
Next
End If
End Sub上面这段程序不全啊。给个完整的。这是照着你给的这点改的。
Static bm As New Bitmap(PictureBox1.Width, PictureBox1.Height)
Dim G As Graphics = Graphics.FromImage(bm)
Dim i As Int16
Dim aa As Int32 = Alf * Math.PI / 180
Dim x1 As Int32 = x + L * Math.Cos(aa)
Dim y1 As Int32 = y + L * Math.Sin(aa)
Dim pen1 As New Pen(Color.Green)
G.DrawLine(pen1, x, 450 - y, x1, 450 - y1)
PictureBox1.Image = bm
PictureBox1.Refresh()
If (n > 0) Then
For i = 0 To 2
x1 = x + L * tr(0)(i) * Math.Cos(aa)
y1 = y + L * tr(0)(i) * Math.Sin(aa)
drawTree(x1, y1, L * tr(1)(i), Alf + tr(2)(i), n - 1)
Next
End If
End Sub上面这段程序不全啊。给个完整的。这是照着你给的这点改的。
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯