Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class Form1
- Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
- Dim x, y, h, l, hf As Single : x = 50 : y = 100 : h = 80
- Dim x1, y1, h1 As Single : x1 = 50 : y1 = 500 : h1 = 20
- Dim i, n, n1 As Integer
- l = Me.Width
- hf = Me.Height
- nebo(hf)
- zem(hf)
- n = Val(InputBox("kol-vo der"))
- n1 = Val(InputBox("kol-vo gribov"))
- h = l / n
- For i = 1 To n
- der(x, y, h, l, hf)
- x = x + 200
- Next
- For i = 1 To n1
- gr(x1, y1, h1, l, hf)
- x1 = x1 + 200
- Next
- End Sub
- End Class
- --------------------------------------------------------------------
- Imports System.Drawing
- Module Module1
- Dim g As Graphics
- Dim b1 As New SolidBrush(Color.Green) 'trava
- Dim b2 As New SolidBrush(Color.Aqua) ' nebo
- Dim b3 As New SolidBrush(Color.SaddleBrown) 'stvol
- Dim b4 As New SolidBrush(Color.GreenYellow) 'list
- Dim b5 As New SolidBrush(Color.SandyBrown) 'nozki
- Dim b6 As New SolidBrush(Color.RosyBrown) 'shlyapa
- Public Sub nebo(ByVal h As Single)
- g = Form1.CreateGraphics
- g.FillRectangle(b2, 0, 0, h * 150, h * 150)
- End Sub
- Public Sub zem(ByVal h As Single)
- g = Form1.CreateGraphics
- g.FillRectangle(b1, 0, h / 3, h * 150, h * 150)
- End Sub
- Public Sub der(ByVal x As Single, ByVal y As Single, ByVal h As Single, ByVal l As Single, ByVal hf As Single)
- g = Form1.CreateGraphics
- g.FillRectangle(b3, x + h / 3, y + h / 2, h / 3, 2 * h)
- g.FillEllipse(b4, x, y, h, h)
- End Sub
- Public Sub gr(ByVal x1 As Single, ByVal y1 As Single, ByVal h1 As Single, ByVal l As Single, ByVal hf As Single)
- g = Form1.CreateGraphics
- g.FillRectangle(b6, x1, y1, h1, 2 * h1)
- g.FillPie(b5, x1 - h1, y1 - 2 * h1, 3 * h1, 4 * h1, 180, 180)
- End Sub
- End Module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement