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()<br />For ptx = 0 To Picture1.ScaleWidth<br />For pty = 0 To Picture1.ScaleHeight<br />DoEvents<br />If Picture1.Point(ptx, pty) = RGB(0, 0, 0) Then<br />GoTo PointPrinter<br />End If<br />Next<br />Next<br />Exit Sub<br />PointDirector:<br />DoEvents<br />color = Picture1.Point(ptx, pty)<br />If color = &H0& Then<br />GoTo PointPrinter<br />Else<br />ptx = ptx + 1<br />color = Picture1.Point(ptx, pty)<br />If color = &H0& Then<br />GoTo PointPrinter<br />Else<br />pty = pty + 1<br />color = Picture1.Point(ptx, pty)<br />If color = &H0& Then<br />GoTo PointPrinter<br />Else<br />ptx = ptx - 1<br />color = Picture1.Point(ptx, pty)<br />If color = &H0& Then<br />GoTo PointPrinter<br />Else<br />ptx = ptx - 1<br />color = Picture1.Point(ptx, pty)<br />If color = &H0& Then<br />GoTo PointPrinter<br />Else<br />pty = pty - 1<br />color = Picture1.Point(ptx, pty)<br />If color = &H0& Then<br />GoTo PointPrinter<br />Else<br />pty = pty - 1<br />color = Picture1.Point(ptx, pty)<br />If color = &H0& Then<br />GoTo PointPrinter<br />Else<br />ptx = ptx + 1<br />GoTo PointPrinter<br />End If<br />End If<br />End If<br />End If<br />End If<br />End If<br />End If<br />Exit Sub
PointPrinter:<br />color = Picture1.Point(ptx, pty)<br />If color = &H0& Then<br />On Error GoTo Outmem<br />Text1.SelText = Str(ptx) + "," + Str(pty) + " "<br />Picture1.PSet (ptx, pty), RGB(242, 243, 52)<br />End If<br />GoTo PointDirector<br />Exit Sub<br />Outmem:<br />MsgBox Err.Description, vbCritical, "Error Number" + Str(Err.Number)<br />Text1.Text = ""<br />Exit Sub