changing the image in a picturebox using an array variable

codecreeper

New member
Joined
Oct 10, 2005
Messages
2
Programming Experience
10+
changing the image in a picturebox using an array variable is driving me bonkers ! I could do this in vb6 no probs but vb.net(2002) doesn't seem to want to let me. The story is this, I'm loading up a text file which contains a path to an image (.jpg) this i the assign to an array variable. I consistently get the error: The given path's format is not supported.
Can anyone help me here? I can enter exactly the same path into the variable manually and it works but when accessing the path from the variable it doesn't. I'm starting to wonder what the heck is going on here as i'm following all instructions implicitly.
 
Thanks for your reply, here goes...

This is the offending code sir, for some reason the fromfile method will not accept my path when held in ModThreePicture(Control), but will when i use the remmed out variable path (which is exactly the same string) it works ! This is making me mad, any suggestions squire ?

'step 1, Grab the image path
'====
count = InStr(LoadedPageData(Control), "[CONTENT]") 'find this and grab left-wards for path
gatheredWord = Microsoft.VisualBasic.Left(LoadedPageData(Control), count - 1) ' info. Gather word
gatheredWord = Microsoft.VisualBasic.Right(gatheredWord, (Len(gatheredWord) - 7))' tidy it up
ModThreePicture(Control) = gatheredWord ' populate array
count = count + 1 ' count is now on the beginning of [content]...
' all the above works fine to gain a correct and present path to an image file...
If ModThreePicture(Control) <> "" Then ' show the image
'path = "C:\ModuleThreeData\images\ea01.jpg"
pbxOne.Image = Image.FromFile(ModThreePicture(Control))

End If
 
Back
Top