[Gambas-user] Coding problem
Fabien3D
creafab at ...402...
Fri Apr 2 23:19:34 CEST 2004
I've got a problem, maybe very simple !
On VB, there were several ways to load a picture to know its dimensions :
1. Loading the picture in an Image control which AutoSize property set to
True. Retrieving the dimensions of the picture was just about knowing the
dimensions of the Image control.
2. Creating a device context (CreateObject, CreateCompatibleDC, SelectObject,
DeleteObject), loading the picture in this device context ad retrieving the
dimensions of the device context.
In Gambas, as a newbie, things seem similar... but different. I suppose I have
to create a class of a picture, load the image into it, and retrieve the
dimensions. But I have some problems in loading the image in the class ! This
is the code :
' Gambas class file
PUBLIC SUB Main()
hImage AS Picture
hImage = NEW hImage
hImage.Picture = Picture["/home/fabien/Economiseur_ecran/Panoramique
Uluru_1.jpg"]
hImage.Visible = TRUE
END
PUBLIC SUB Form_Open()
pcbScreenSaver.Left = 0
pcbScreenSaver.Top = 0
pcbScreenSaver.Picture = hImage.Picture
END
I know the last line is wrong. But how can I get the result suggested by the
code of this line ?
--
Fabien3D
CREAFab, la création numérique autrement...
http://creafab.free.fr
More information about the User
mailing list