' Saves sections of the image
'The user mouse selects the Y value of the image which is stored in Section()
Private Sub btn2SaveAll_Click
For x = 1 To SectionCounter
img1= img.Crop(0,Sections(x-1),img.Width,Sections(x)-Sections(x-1))
Dim Filename As String = "RodPlay" & x & ".jpg"
out = File.OpenOutput(File.DirApp &"/Drawings/1",Filename , False) ' creates the file
img1.WriteToStream(out,100,"JPEG") ' writes image to folder
Next
End Sub
Private Sub DeleteFiles(FileName As String)
Dim AllFiles As List
AllFiles.Initialize
AllFiles.AddAll(File.ListFiles(FileName))
'For i=0 To AllFiles.Size-1 Step 1
For i=0 To AllFiles.Size-1
Dim x As String=AllFiles.Get(i)
Log(x)
Log(File.Delete(FileName,x))
Next
End Sub
Private Sub btnClear_Click
Canvas1.ClearRect(0,0,Canvas1.Width,Canvas1.Height) ' clears the selection lines
DeleteFiles(File.DirApp &"/Drawings/1")
End Sub