VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   5220
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   8580
   LinkTopic       =   "Form1"
   ScaleHeight     =   5220
   ScaleWidth      =   8580
   StartUpPosition =   3  'Windows Default
   Begin VB.OptionButton Option5 
      Caption         =   "Овал"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   204
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   5760
      TabIndex        =   22
      Top             =   4560
      Width           =   1215
   End
   Begin VB.OptionButton Option17 
      BackColor       =   &H000000C0&
      Height          =   255
      Left            =   7680
      TabIndex        =   20
      Top             =   2280
      Width           =   855
   End
   Begin VB.OptionButton Option16 
      BackColor       =   &H00800080&
      Height          =   255
      Left            =   7680
      TabIndex        =   19
      Top             =   600
      Width           =   855
   End
   Begin VB.OptionButton Option15 
      BackColor       =   &H000080FF&
      Height          =   255
      Left            =   7680
      TabIndex        =   18
      Top             =   1800
      Width           =   855
   End
   Begin VB.OptionButton Option14 
      BackColor       =   &H00C0C0C0&
      Height          =   255
      Left            =   7680
      TabIndex        =   17
      Top             =   2760
      Width           =   855
   End
   Begin VB.OptionButton Option13 
      BackColor       =   &H00FF00FF&
      Height          =   255
      Left            =   7680
      TabIndex        =   16
      Top             =   360
      Width           =   855
   End
   Begin VB.OptionButton Option12 
      BackColor       =   &H00FFFFFF&
      Height          =   255
      Left            =   7680
      TabIndex        =   15
      Top             =   2520
      Width           =   855
   End
   Begin VB.OptionButton Option11 
      BackColor       =   &H00000000&
      Height          =   255
      Left            =   7680
      TabIndex        =   14
      Top             =   3000
      Width           =   855
   End
   Begin VB.OptionButton Option10 
      BackColor       =   &H00FF0000&
      Height          =   255
      Left            =   7680
      TabIndex        =   13
      Top             =   840
      Width           =   855
   End
   Begin VB.OptionButton Option9 
      BackColor       =   &H000000FF&
      Height          =   255
      Left            =   7680
      TabIndex        =   12
      Top             =   2040
      Width           =   855
   End
   Begin VB.OptionButton Option8 
      BackColor       =   &H0000FFFF&
      Height          =   255
      Left            =   7680
      TabIndex        =   11
      Top             =   1560
      Width           =   855
   End
   Begin VB.OptionButton Option7 
      BackColor       =   &H0000FF00&
      Height          =   255
      Left            =   7680
      TabIndex        =   10
      Top             =   1320
      Width           =   855
   End
   Begin VB.OptionButton Option6 
      BackColor       =   &H00FFFF00&
      Height          =   255
      Left            =   7680
      TabIndex        =   9
      Top             =   1080
      Width           =   855
   End
   Begin VB.OptionButton Option4 
      Caption         =   "Пятиугольник"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   204
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   1680
      TabIndex        =   8
      Top             =   4560
      Width           =   2175
   End
   Begin VB.OptionButton Option3 
      Caption         =   "Звезда"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   204
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   4080
      TabIndex        =   7
      Top             =   4560
      Width           =   1575
   End
   Begin VB.OptionButton Option2 
      Caption         =   "Четырёхугольник"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   204
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   4080
      TabIndex        =   6
      Top             =   3960
      Width           =   2655
   End
   Begin VB.OptionButton Option1 
      Caption         =   "Треугольник"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   204
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   1680
      TabIndex        =   5
      Top             =   3960
      Width           =   2175
   End
   Begin VB.PictureBox Picture1 
      BackColor       =   &H00FFFFFF&
      Height          =   3735
      Left            =   120
      ScaleHeight     =   3675
      ScaleWidth      =   6915
      TabIndex        =   2
      Top             =   120
      Width           =   6975
   End
   Begin VB.CommandButton Command2 
      Caption         =   "Очистка"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   204
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   7200
      TabIndex        =   1
      Top             =   3840
      Width           =   1215
   End
   Begin VB.CommandButton Command1 
      Caption         =   "Выход"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   204
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   7200
      TabIndex        =   0
      Top             =   4560
      Width           =   1215
   End
   Begin VB.Label Label3 
      Caption         =   "Рисование"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   204
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   7200
      TabIndex        =   21
      Top             =   120
      Width           =   1215
   End
   Begin VB.Line Line2 
      X1              =   1680
      X2              =   6720
      Y1              =   4440
      Y2              =   4440
   End
   Begin VB.Line Line1 
      X1              =   3960
      X2              =   3960
      Y1              =   3960
      Y2              =   5040
   End
   Begin VB.Label Label2 
      Caption         =   "Коорд Y"
      Height          =   495
      Left            =   120
      TabIndex        =   4
      Top             =   4560
      Width           =   1935
   End
   Begin VB.Label Label1 
      Caption         =   "Коорд X"
      Height          =   495
      Left            =   120
      TabIndex        =   3
      Top             =   3960
      Width           =   1935
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim XX(1 To 30) As Single, YY(1 To 30) As Single, frmClip As Single, n As Integer
Dim i, j As Integer, cw As Double

Private Sub Form_Resize()
Picture1.Width = ScaleWidth - 1600
Picture1.Height = ScaleHeight - 1500
Command1.Top = ScaleHeight - 700
Command1.Left = ScaleWidth - 1300
Command2.Top = ScaleHeight - 1500
Command2.Left = ScaleWidth - 1300
Option13.Left = ScaleWidth - 1300
Option11.Left = ScaleWidth - 1300
Option12.Left = ScaleWidth - 1300
Option14.Left = ScaleWidth - 1300
Option15.Left = ScaleWidth - 1300
Option16.Left = ScaleWidth - 1300
Option17.Left = ScaleWidth - 1300
Option10.Left = ScaleWidth - 1300
Option9.Left = ScaleWidth - 1300
Option8.Left = ScaleWidth - 1300
Option7.Left = ScaleWidth - 1300
Option6.Left = ScaleWidth - 1300
Option1.Left = ScaleWidth - 6800
Option2.Left = ScaleWidth - 4300
Option3.Left = ScaleWidth - 4300
Option4.Left = ScaleWidth - 6800
Option1.Top = ScaleHeight - 1300
Option2.Top = ScaleHeight - 1300
Option3.Top = ScaleHeight - 500
Option4.Top = ScaleHeight - 500

End Sub

Private Sub Command1_Click()
End

End Sub

Private Sub Command2_Click()
Picture1.Cls

End Sub

Private Sub Form_Load()
Picture1.Scale (0, 0)-(100, 100)
Picture1.PSet (0, 0)
For i = 1 To 30
XX(i) = 0
YY(i) = 0
Next
i = 0
Option11.Value = True
cw = vbBlack
End Sub

Private Sub Option10_Click()
cw = &HFF0000
End Sub

Private Sub Option11_Click()
cw = &H0&
End Sub

Private Sub Option12_Click()
cw = &HFFFFFF
End Sub

Private Sub Option13_Click()
cw = 16711935
End Sub

Private Sub Option14_Click()
cw = &HC0C0C0
End Sub

Private Sub Option15_Click()
cw = &H80FF&
End Sub

Private Sub Option16_Click()
cw = 8388736
End Sub

Private Sub Option17_Click()
cw = &HC0&
End Sub

Private Sub Option6_Click()
cw = &HFFFF00
End Sub

Private Sub Option7_Click()
cw = &HFF00&
End Sub

Private Sub Option8_Click()
cw = &HFFFF&
End Sub

Private Sub Option9_Click()
cw = &HFF&
End Sub

Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
 If Button = 1 And Option1.Value = False And Option4.Value = False And Option3.Value = False And Option2.Value = False Then
 Picture1.Line (Picture1.CurrentX, Picture1.CurrentY)-(X, Y), cw
 End If
End Sub

Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
 Picture1.CurrentX = X
Picture1.CurrentY = Y

 If (Button = 2 Or Button = 4) And (Option5.Value = True Or Option1.Value = True Or Option4.Value = True Or Option3.Value = True Or Option2.Value = True) Then

i = i + 1
XX(i) = X
YY(i) = Y
Label1.Caption = "X=" + Str(XX(i))
Label2.Caption = "Y=" + Str(YY(i))

Picture1.PSet (X, Y)
If i >= 3 And Option1.Value = True And Button = 2 Then
n = 3

For j = 1 To n - 1
Picture1.Line (XX(j), YY(j))-(XX(j + 1), YY(j + 1)), cw
Next
Picture1.Line (XX(n), YY(n))-(XX(1), YY(1)), cw
i = 0
End If
If i >= 4 And Option2.Value = True And Button = 2 Then
n = 4

For j = 1 To n - 1
Picture1.Line (XX(j), YY(j))-(XX(j + 1), YY(j + 1)), cw
Next
Picture1.Line (XX(n), YY(n))-(XX(1), YY(1)), cw
i = 0
End If
If i >= 5 And Option4.Value = True And Button = 2 Then
n = 5

For j = 1 To n - 1
Picture1.Line (XX(j), YY(j))-(XX(j + 1), YY(j + 1)), cw
Next
Picture1.Line (XX(n), YY(n))-(XX(1), YY(1)), cw
i = 0
End If

If i >= 5 And Option3.Value = True And Button = 2 Then
n = 5

For j = 1 To n - 2

Picture1.Line (XX(j), YY(j))-(XX(j + 2), YY(j + 2)), cw
If j <= 2 Then Picture1.Line (XX(j), YY(j))-(XX(j + 3), YY(j + 3)), cw

Next

Picture1.Line (XX(n), YY(n))-(XX(2), YY(2)), cw

i = 0

End If
If Button = 4 And i = 3 Then
Picture1.PSet (XX(1), YY(1)), cw
On Error GoTo mm
Picture1.Circle Step(0, 0), Abs(XX(2) - XX(1)), cw, , , Abs(YY(3) - YY(1)) / Abs(XX(2) - XX(1))
mm:
i = 0
End If

End If
End Sub

