[Gambas-user] VB <-> Gambas: LoadPicture-Function
Benoit Minisini
gambas at ...1...
Sat Aug 28 23:25:41 CEST 2004
On Saturday 28 August 2004 23:08, daydreamer wrote:
> hi!
> i tried to load a picture into a
> picturebox with the VB-function loadpicture,
> but it didn't work.
> Is there a function in Gambas,
> which is like this ?
>
> thanks
> Fabian
> --------------------
> sorry about my bad English - I'm German :-)
>
To put a picture in a Picture box, you have three ways:
1) Get it from another control :-)
hPictureBox.Picture = hAnotherPictureBox.Picture
2) Create a new picture from a file and put it in the PictureBox.
DIM hPicture AS Picture
hPicture = NEW Picture
hPicture.Load("/path/to/my/picture")
hPictureBox.Picture = hPicture
3) Use the internal picture cache.
hPictureBox.Picture = Picture["/path/to/my/picture"]
The picture is stored in the cache, so that the next time you want the same
file, the same picture object is returned.
Regards,
--
Benoit Minisini
mailto:gambas at ...1...
More information about the User
mailing list