VERSION 5.00
Begin VB.Form Tools 
   BorderStyle     =   4  'Fixed ToolWindow
   Caption         =   "Picture Tools"
   ClientHeight    =   972
   ClientLeft      =   36
   ClientTop       =   276
   ClientWidth     =   11856
   KeyPreview      =   -1  'True
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   81
   ScaleMode       =   3  'Pixel
   ScaleWidth      =   988
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  'Windows Default
   Begin VB.CheckBox Check2 
      Caption         =   "Use DM2 palette:"
      Height          =   288
      Left            =   2208
      TabIndex        =   48
      Top             =   672
      Value           =   1  'Checked
      Visible         =   0   'False
      Width           =   1500
   End
   Begin VB.CommandButton Command3 
      Caption         =   "Analyse"
      Height          =   300
      Left            =   10176
      TabIndex        =   46
      Top             =   624
      Width           =   876
   End
   Begin VB.CommandButton Command2 
      Caption         =   "Save"
      Height          =   396
      Left            =   11136
      TabIndex        =   45
      Top             =   480
      Width           =   684
   End
   Begin VB.CommandButton Command1 
      Caption         =   "Load"
      Height          =   396
      Left            =   11136
      TabIndex        =   44
      Top             =   48
      Width           =   684
   End
   Begin VB.CommandButton Command11 
      Caption         =   "/\ |"
      Height          =   456
      Index           =   0
      Left            =   9480
      TabIndex        =   43
      Top             =   0
      Width           =   300
   End
   Begin VB.CommandButton Command11 
      Caption         =   "-->"
      Height          =   300
      Index           =   1
      Left            =   9792
      TabIndex        =   42
      Top             =   432
      Width           =   300
   End
   Begin VB.CommandButton Command11 
      Caption         =   "| \/"
      Height          =   456
      Index           =   2
      Left            =   9480
      TabIndex        =   41
      Top             =   528
      Width           =   300
   End
   Begin VB.CommandButton Command11 
      Caption         =   "<--"
      Height          =   300
      Index           =   3
      Left            =   9168
      TabIndex        =   40
      Top             =   432
      Width           =   300
   End
   Begin VB.TextBox Text7 
      Height          =   288
      Left            =   10416
      TabIndex        =   38
      Text            =   "0"
      Top             =   288
      Width           =   396
   End
   Begin VB.OptionButton Option1 
      Caption         =   "Draw"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   7.8
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   300
      Index           =   0
      Left            =   1200
      Style           =   1  'Graphical
      TabIndex        =   2
      Top             =   0
      Value           =   -1  'True
      Width           =   876
   End
   Begin VB.OptionButton Option1 
      Caption         =   "Fill"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   7.8
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   300
      Index           =   1
      Left            =   1200
      Style           =   1  'Graphical
      TabIndex        =   1
      Top             =   336
      Width           =   876
   End
   Begin VB.OptionButton Option1 
      Caption         =   "Replace"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   7.8
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   300
      Index           =   2
      Left            =   1200
      Style           =   1  'Graphical
      TabIndex        =   0
      Top             =   672
      Width           =   876
   End
   Begin VB.Label Label17 
      AutoSize        =   -1  'True
      Caption         =   "(DM2 Palette)"
      Height          =   192
      Left            =   3840
      TabIndex        =   49
      Top             =   720
      Visible         =   0   'False
      Width           =   972
   End
   Begin VB.Shape Shape1 
      BackColor       =   &H00000000&
      BackStyle       =   1  'Opaque
      BorderStyle     =   0  'Transparent
      Height          =   96
      Left            =   864
      Top             =   768
      Width           =   96
   End
   Begin VB.Label Label99 
      Alignment       =   2  'Center
      AutoSize        =   -1  'True
      Caption         =   "Brush Size:"
      Height          =   192
      Left            =   0
      TabIndex        =   47
      Top             =   768
      Width           =   804
   End
   Begin VB.Label Label12 
      Alignment       =   2  'Center
      AutoSize        =   -1  'True
      Caption         =   "Contrast (%)"
      Height          =   192
      Left            =   10176
      TabIndex        =   39
      Top             =   48
      Width           =   876
   End
   Begin VB.Label Label13 
      Alignment       =   2  'Center
      AutoSize        =   -1  'True
      Caption         =   "0"
      Height          =   192
      Left            =   24
      TabIndex        =   37
      Top             =   192
      Width           =   1068
   End
   Begin VB.Label Label18 
      Alignment       =   2  'Center
      AutoSize        =   -1  'True
      Caption         =   "RGB"
      Height          =   192
      Left            =   360
      TabIndex        =   36
      Top             =   0
      Width           =   372
   End
   Begin VB.Label Label4 
      Alignment       =   2  'Center
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      BorderStyle     =   1  'Fixed Single
      DragMode        =   1  'Automatic
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.6
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   240
      Index           =   16
      Left            =   432
      TabIndex        =   35
      Top             =   480
      Width           =   240
   End
   Begin VB.Label Label4 
      Alignment       =   2  'Center
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      BorderStyle     =   1  'Fixed Single
      DragMode        =   1  'Automatic
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.6
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   240
      Index           =   0
      Left            =   2304
      TabIndex        =   34
      Top             =   324
      Width           =   240
   End
   Begin VB.Label Label4 
      Alignment       =   2  'Center
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      BorderStyle     =   1  'Fixed Single
      DragMode        =   1  'Automatic
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.6
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   240
      Index           =   1
      Left            =   2784
      TabIndex        =   33
      Top             =   324
      Width           =   240
   End
   Begin VB.Label Label4 
      Alignment       =   2  'Center
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      BorderStyle     =   1  'Fixed Single
      DragMode        =   1  'Automatic
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.6
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   240
      Index           =   2
      Left            =   3216
      TabIndex        =   32
      Top             =   324
      Width           =   240
   End
   Begin VB.Label Label4 
      Alignment       =   2  'Center
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      BorderStyle     =   1  'Fixed Single
      DragMode        =   1  'Automatic
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.6
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   240
      Index           =   3
      Left            =   3648
      TabIndex        =   31
      Top             =   324
      Width           =   240
   End
   Begin VB.Label Label4 
      Alignment       =   2  'Center
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      BorderStyle     =   1  'Fixed Single
      DragMode        =   1  'Automatic
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.6
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   240
      Index           =   4
      Left            =   4080
      TabIndex        =   30
      Top             =   324
      Width           =   240
   End
   Begin VB.Label Label4 
      Alignment       =   2  'Center
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      BorderStyle     =   1  'Fixed Single
      DragMode        =   1  'Automatic
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.6
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   240
      Index           =   5
      Left            =   4512
      TabIndex        =   29
      Top             =   324
      Width           =   240
   End
   Begin VB.Label Label4 
      Alignment       =   2  'Center
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      BorderStyle     =   1  'Fixed Single
      DragMode        =   1  'Automatic
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.6
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   240
      Index           =   6
      Left            =   4944
      TabIndex        =   28
      Top             =   324
      Width           =   240
   End
   Begin VB.Label Label4 
      Alignment       =   2  'Center
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      BorderStyle     =   1  'Fixed Single
      DragMode        =   1  'Automatic
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.6
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   240
      Index           =   7
      Left            =   5376
      TabIndex        =   27
      Top             =   324
      Width           =   240
   End
   Begin VB.Label Label4 
      Alignment       =   2  'Center
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      BorderStyle     =   1  'Fixed Single
      DragMode        =   1  'Automatic
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.6
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   240
      Index           =   8
      Left            =   5808
      TabIndex        =   26
      Top             =   324
      Width           =   240
   End
   Begin VB.Label Label4 
      Alignment       =   2  'Center
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      BorderStyle     =   1  'Fixed Single
      DragMode        =   1  'Automatic
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.6
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   240
      Index           =   9
      Left            =   6240
      TabIndex        =   25
      Top             =   324
      Width           =   240
   End
   Begin VB.Label Label4 
      Alignment       =   2  'Center
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      BorderStyle     =   1  'Fixed Single
      DragMode        =   1  'Automatic
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.6
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   240
      Index           =   10
      Left            =   6672
      TabIndex        =   24
      Top             =   324
      Width           =   240
   End
   Begin VB.Label Label4 
      Alignment       =   2  'Center
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      BorderStyle     =   1  'Fixed Single
      DragMode        =   1  'Automatic
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.6
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   240
      Index           =   11
      Left            =   7104
      TabIndex        =   23
      Top             =   324
      Width           =   240
   End
   Begin VB.Label Label4 
      Alignment       =   2  'Center
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      BorderStyle     =   1  'Fixed Single
      DragMode        =   1  'Automatic
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.6
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   240
      Index           =   12
      Left            =   7536
      TabIndex        =   22
      Top             =   324
      Width           =   240
   End
   Begin VB.Label Label4 
      Alignment       =   2  'Center
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      BorderStyle     =   1  'Fixed Single
      DragMode        =   1  'Automatic
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.6
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   240
      Index           =   13
      Left            =   7968
      TabIndex        =   21
      Top             =   324
      Width           =   240
   End
   Begin VB.Label Label4 
      Alignment       =   2  'Center
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      BorderStyle     =   1  'Fixed Single
      DragMode        =   1  'Automatic
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.6
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   240
      Index           =   14
      Left            =   8400
      TabIndex        =   20
      Top             =   324
      Width           =   240
   End
   Begin VB.Label Label4 
      Alignment       =   2  'Center
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      BorderStyle     =   1  'Fixed Single
      DragMode        =   1  'Automatic
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.6
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   240
      Index           =   15
      Left            =   8832
      TabIndex        =   19
      Top             =   324
      Width           =   240
   End
   Begin VB.Label Label14 
      Alignment       =   2  'Center
      AutoSize        =   -1  'True
      Caption         =   "0"
      Height          =   240
      Index           =   0
      Left            =   2358
      TabIndex        =   18
      Top             =   48
      Width           =   132
   End
   Begin VB.Label Label14 
      Alignment       =   2  'Center
      AutoSize        =   -1  'True
      Caption         =   "0"
      Height          =   240
      Index           =   1
      Left            =   2832
      TabIndex        =   17
      Top             =   48
      Width           =   132
   End
   Begin VB.Label Label14 
      Alignment       =   2  'Center
      AutoSize        =   -1  'True
      Caption         =   "0"
      Height          =   240
      Index           =   2
      Left            =   3264
      TabIndex        =   16
      Top             =   48
      Width           =   132
   End
   Begin VB.Label Label14 
      Alignment       =   2  'Center
      AutoSize        =   -1  'True
      Caption         =   "0"
      Height          =   240
      Index           =   3
      Left            =   3696
      TabIndex        =   15
      Top             =   48
      Width           =   132
   End
   Begin VB.Label Label14 
      Alignment       =   2  'Center
      AutoSize        =   -1  'True
      Caption         =   "0"
      Height          =   240
      Index           =   4
      Left            =   4128
      TabIndex        =   14
      Top             =   48
      Width           =   132
   End
   Begin VB.Label Label14 
      Alignment       =   2  'Center
      AutoSize        =   -1  'True
      Caption         =   "0"
      Height          =   240
      Index           =   5
      Left            =   4560
      TabIndex        =   13
      Top             =   48
      Width           =   132
   End
   Begin VB.Label Label14 
      Alignment       =   2  'Center
      AutoSize        =   -1  'True
      Caption         =   "0"
      Height          =   240
      Index           =   6
      Left            =   4992
      TabIndex        =   12
      Top             =   48
      Width           =   132
   End
   Begin VB.Label Label14 
      Alignment       =   2  'Center
      AutoSize        =   -1  'True
      Caption         =   "0"
      Height          =   240
      Index           =   7
      Left            =   5424
      TabIndex        =   11
      Top             =   48
      Width           =   132
   End
   Begin VB.Label Label14 
      Alignment       =   2  'Center
      AutoSize        =   -1  'True
      Caption         =   "0"
      Height          =   240
      Index           =   8
      Left            =   5856
      TabIndex        =   10
      Top             =   48
      Width           =   132
   End
   Begin VB.Label Label14 
      Alignment       =   2  'Center
      AutoSize        =   -1  'True
      Caption         =   "0"
      Height          =   240
      Index           =   9
      Left            =   6288
      TabIndex        =   9
      Top             =   48
      Width           =   132
   End
   Begin VB.Label Label14 
      Alignment       =   2  'Center
      AutoSize        =   -1  'True
      Caption         =   "0"
      Height          =   240
      Index           =   10
      Left            =   6720
      TabIndex        =   8
      Top             =   48
      Width           =   132
   End
   Begin VB.Label Label14 
      Alignment       =   2  'Center
      AutoSize        =   -1  'True
      Caption         =   "0"
      Height          =   240
      Index           =   11
      Left            =   7152
      TabIndex        =   7
      Top             =   48
      Width           =   132
   End
   Begin VB.Label Label14 
      Alignment       =   2  'Center
      AutoSize        =   -1  'True
      Caption         =   "0"
      Height          =   240
      Index           =   12
      Left            =   7584
      TabIndex        =   6
      Top             =   48
      Width           =   132
   End
   Begin VB.Label Label14 
      Alignment       =   2  'Center
      AutoSize        =   -1  'True
      Caption         =   "0"
      Height          =   240
      Index           =   13
      Left            =   8016
      TabIndex        =   5
      Top             =   48
      Width           =   132
   End
   Begin VB.Label Label14 
      Alignment       =   2  'Center
      AutoSize        =   -1  'True
      Caption         =   "0"
      Height          =   240
      Index           =   14
      Left            =   8448
      TabIndex        =   4
      Top             =   48
      Width           =   132
   End
   Begin VB.Label Label14 
      Alignment       =   2  'Center
      AutoSize        =   -1  'True
      Caption         =   "0"
      Height          =   240
      Index           =   15
      Left            =   8880
      TabIndex        =   3
      Top             =   48
      Width           =   132
   End
   Begin VB.Shape Shape2 
      BackColor       =   &H00000000&
      BackStyle       =   1  'Opaque
      Height          =   432
      Left            =   2208
      Top             =   228
      Width           =   432
   End
End
Attribute VB_Name = "Tools"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub Command1_Click()
Graphread.Loadbmp_Click
End Sub

Private Sub Command2_Click()
Graphread.Savebmp_Click
End Sub

Private Sub Command3_Click()
Graphread.Analyse_Click
End Sub

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
activar KeyCode, Shift, Me
End Sub

Private Sub Form_Load()
For contador = 0 To 15
    Label14(contador).Caption = Hex(contador)
Next
End Sub

 Sub Label17_Click()
Dim contador As Integer, contador2 As Integer, contador3 As Integer, color As Long, color2 As Long
Graphread.Label8.Caption = "Colouring..."
Graphread.Label8.Visible = True
init3 DM2clarity - clarity / 10
For contador2 = 0 To Graphread.Picture2.Height - 1
    For contador = 0 To Graphread.Picture2.Width - 1
        color = Graphread.Picture2.Point(contador, contador2)
        For contador3 = 0 To 15
            If color = palettes(contador3) Then Exit For
        Next
        If contador3 < 16 Then
            color = val2("&H" & Mid$(Label17.Caption, contador3 * 2 + 1, 1))
            color2 = val2("&H" & Mid$(Label17.Caption, contador3 * 2 + 2, 1))
            color = dm2colors(color, color2)
            Graphread.Picture2.PSet (contador, contador2), color
        End If
    Next
    Graphread.Picture2.Refresh
Next
SavePicture Graphread.Picture2.Image, "tmpimage"
Graphread.Picture2.Picture = LoadPicture("tmpimage")
If Len(Dir("tmpimage")) > 0 Then Kill "tmpimage"

Zoom.image1_DragDrop Graphread.Picture2, 1, 1
Graphread.Label8.Visible = False
End Sub

 Sub label4_DragDrop(Index As Integer, Source As Control, X As Single, Y As Single)
If LCase(Source.Name) <> "label4" Then Exit Sub
choosecolor Index
color2 = Source.BackColor
Source.BackColor = Label4(Index).BackColor
Label4(Index).BackColor = color2
cadena = "&H"
For contador = 8 To &HD
    For contador2 = 0 To 15
        If palettes(contador2) = Label4(contador).BackColor Then Exit For
    Next
    cadena = cadena + Hex(contador2)
Next
Info.Text2.Text = cadena
hexs = Hex(val2(Left(Info.Text2.Text, 8)))
Info.Text2.Text = "&H" & String(6 - Len(hexs), "0") & hexs
putcaptionpalette
End Sub

Sub Text7_Change()
contador = Abs(val2(Text7.Text))
If contador > 100 Then contador = 100
Text7.Text = contador
clarity = contador

End Sub
 Sub Command11_Click(Index As Integer)
Select Case Index
Case 0  'Northward
    For contador2 = 0 To Graphread.Picture2.Height - 2
        For contador = 0 To Graphread.Picture2.Width - 1
            Graphread.Picture2.PSet (contador, contador2), Graphread.Picture2.Point(contador, contador2 + 1)
        Next
    Next
    For contador = 0 To Graphread.Picture2.Width - 1
        Graphread.Picture2.PSet (contador, Graphread.Picture2.Height - 1), RGB(255, 0, 255)
    Next
Case 1  'Eastward
    For contador = Graphread.Picture2.Width - 1 To 1 Step -1
        For contador2 = 0 To Graphread.Picture2.Height - 1
            Graphread.Picture2.PSet (contador, contador2), Graphread.Picture2.Point(contador - 1, contador2)
        Next
    Next
    For contador2 = 0 To Graphread.Picture2.Height - 1
        Graphread.Picture2.PSet (0, contador2), RGB(255, 0, 255)
    Next
Case 2  'Southward
    For contador2 = Graphread.Picture2.Height - 1 To 1 Step -1
        For contador = 0 To Graphread.Picture2.Width - 1
            Graphread.Picture2.PSet (contador, contador2), Graphread.Picture2.Point(contador, contador2 - 1)
        Next
    Next
    For contador = 0 To Graphread.Picture2.Width - 1
        Graphread.Picture2.PSet (contador, 0), RGB(255, 0, 255)
    Next
Case 3  'Westward
    For contador = 0 To Graphread.Picture2.Width - 2
        For contador2 = 0 To Graphread.Picture2.Height - 1
            Graphread.Picture2.PSet (contador, contador2), Graphread.Picture2.Point(contador + 1, contador2)
        Next
    Next
    For contador2 = 0 To Graphread.Picture2.Height - 1
        Graphread.Picture2.PSet (Graphread.Picture2.Width - 1, contador2), RGB(255, 0, 255)
    Next
End Select
SavePicture Graphread.Picture2.Image, "tmpimage"
Graphread.Picture2.Picture = LoadPicture("tmpimage")
If Len(Dir("tmpimage")) > 0 Then Kill "tmpimage"
Zoom.image1_DragDrop Graphread.Picture2, 1, 1
End Sub

Sub Label99_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 And Tools.Shape1.Width < 16 Then
    Tools.Shape1.Width = Tools.Shape1.Width + 1
    Tools.Shape1.Height = Tools.Shape1.Width + 1
End If
If Button = 2 And Tools.Shape1.Width > 3 Then
    Tools.Shape1.Width = Tools.Shape1.Width - 1
    Tools.Shape1.Height = Tools.Shape1.Width - 1
End If

End Sub

