MAX OS X Desktop
I have a Listbox where in one column I save the name of a .jpg file.
I have the default path to the directory where the .jpg’s are stored, saved in a text file called “Connect.txt”
When I move thru the lines of the listbox, I am assigning the picture, based on the listbox line and column, to load in Canvas1.
My problem is after I load the default path that I saved in my .txt file, I am not sure how to assign the path plus the file name in my listbox to the canvas.
Here is my code:
//-----------------------------------------
dim FI as FolderItem
dim TOS as textInputStream
//******************
FI = SpecialFolder.ApplicationData()
FI = FI.Child (“Connect.txt”)
If FI.Exists Then
TOS = TextinputStream.Open(FI)
Dim MyParameter as string = TOS.ReadLine
TOS.Close
TextField1.text = MyParameter
End If
Dim p as Picture
Dim MyFile as FolderItem = MyParameter.Child(productLST.cell(productLST.ListIndex, 3)+" - 0.jpg")
p = Picture.Open(MyFile)
If productLST.ListIndex >=0 Then
If MyFile.Exists then
canvas1.graphics.drawpicture p,0,0, canvas1.width,canvas1.height,0,0,p.width,p.height
picLBL.text = (productLST.cell(productLST.ListIndex, 3)+" - 0.jpg")
Else
Canvas1.Backdrop = Nil
picLBL.text = “”
End IF
End IF
//-----------------------------------------
In the above code, if I change MyFile to:
Dim MyFile as FolderItem = SpecialFolder.Home.Child(“jeff”).Child(“Dropbox”).Child(“ImportFirst”).Child(“Inventory”).Child(“productshots”).Child(productLST.cell(productLST.ListIndex, 3)+" - 0.jpg")
Then it loads the file fine, but I don’t want to code the default path, I want to load and use the default path from the “Connect.txt” file that I have saved.
I think the problem is with the syntax trying to use “MyParameter” in: Dim MyFile as FolderItem = MyParameter.Child(productLST.cell(productLST.ListIndex, 3)+" - 0.jpg")
Thanks!