Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Tailor Master 1.1 -Asim Abbasi

0.00/5 (No votes)
25 Feb 2007 1  
Visual Basic Project. The software then generates the coordinates sequentially and send them to the microcontroller.

Screenshot - tailorm.gif

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

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here