[Gambas-user] Picture Viewer Project
Bodard Fabien
gambasfr at ...11...
Mon Mar 14 21:31:31 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?
PUBLIC SUB fileList_Select()
MyPicture.Picture = Picture[mydir &/ filelist.current.text]
END
That's all :)
in fact filelist.current return an object (.listitem) not text.
Fabien Bodard
More information about the User
mailing list