Introduction
This software is created in Visual Basic 5. It is designed to interface it with the microcontroller in order to cut the metallic sheets. User can input the software patterns in which sheets are to cut, in the form of jpg, gif, bmp or wmf file formats. The software then generates the coordinates sequentially and send them to the microcontroller. You can also saved the generated coordinates for later use. The main routine is shown below. The complete code (project) resides inside the zip file.
Private Sub Command3_Click()
For ptx = 0 To Picture1.ScaleWidth
For pty = 0 To Picture1.ScaleHeight
DoEvents
If Picture1.Point(ptx, pty) = RGB(0, 0, 0) Then
GoTo PointPrinter
End If
Next
Next
Exit Sub
PointDirector:
DoEvents
color = Picture1.Point(ptx, pty)
If color = &H0& Then
GoTo PointPrinter
Else
ptx = ptx + 1
color = Picture1.Point(ptx, pty)
If color = &H0& Then
GoTo PointPrinter
Else
pty = pty + 1
color = Picture1.Point(ptx, pty)
If color = &H0& Then
GoTo PointPrinter
Else
ptx = ptx - 1
color = Picture1.Point(ptx, pty)
If color = &H0& Then
GoTo PointPrinter
Else
ptx = ptx - 1
color = Picture1.Point(ptx, pty)
If color = &H0& Then
GoTo PointPrinter
Else
pty = pty - 1
color = Picture1.Point(ptx, pty)
If color = &H0& Then
GoTo PointPrinter
Else
pty = pty - 1
color = Picture1.Point(ptx, pty)
If color = &H0& Then
GoTo PointPrinter
Else
ptx = ptx + 1
GoTo PointPrinter
End If
End If
End If
End If
End If
End If
End If
Exit Sub
PointPrinter:
color = Picture1.Point(ptx, pty)
If color = &H0& Then
On Error GoTo Outmem
Text1.SelText = Str(ptx) + "," + Str(pty) + " "
Picture1.PSet (ptx, pty), RGB(242, 243, 52)
End If
GoTo PointDirector
Exit Sub
Outmem:
MsgBox Err.Description, vbCritical, "Error Number" + Str(Err.Number)
Text1.Text = ""
Exit Sub