[Gambas-user] Picture Viewer Project
Laurent Carlier
lordheavy at ...512...
Mon Mar 14 21:40:03 CET 2005
Le Lundi 14 Mars 2005 21:19, Michael Sullivan a écrit :
> I've gotten past the Null Object error. Here is my code:
>
> PUBLIC SUB fileList_Select()
> DIM hPic AS Picture
> DIM tempPic AS String
>
> tempPic = myDir & "/" & Str(fileList.Current)
> hPic = NEW Picture
> hPic.Load(tempPic)
>
> MyPicture.Picture = hPic
>
> END
>
> But whenever I pick any picture filename I get the error "Unable to load
> picture". The documentation says that the PictureBox control can load
> jpegs. The picture I tried it on was a jpg. Does that make a
> difference? What am I doing wrong?
>
Perhaps tempPic = myDir & "/" & Str(fileList.Current) isn't a valid file
path ! try to add a print tempPic line to test the path !
Or use debug fonctionality of the IDE !
Regards,
--
Laurent Carlier
More information about the User
mailing list