Dear visitor, welcome to Jabaco - Community.
If this is your first visit here, please read the Help. It explains in detail how this page works.
To use all features of this page, you should consider registering.
Please use the registration form, to register here or read more information about the registration process.
If you are already registered, please login here.
Loadpicture
I discovered Jabaco today, after failing to re-install VB6 in XP (haven't used it for years), and I really like what I've seen so far.
Right now, I'm trying to use the Loadpicture function, but can't seem to find the right way.
I've tried with:
picture1.picture = Loadpicture ("bg.jpg")
The bg.jpg file is in the same folder than the project is saved.
picture1.picture = Loadpicture (pantalla)
pantalla is a variable with the path to a jpg file.
picture1.picture = Loadpicture BgJpg
Using the "autocomplete" feature of the editor.
I guess my references are out of date, or there is something else I'm missing?
picture1 already has a file assigned to it before I try to change it
Thanks for any help,
Diego
Right now, I'm trying to use the Loadpicture function, but can't seem to find the right way.
Hmm... Yes - I have to documentate the usage of IResource. This is the Jabaco-Method to embed a resource (like images) in a Exe/Jar-File.
picture1.picture = Loadpicture ("bg.jpg")
The bg.jpg file is in the same folder than the project is saved.
I'll proof this method for a future Framework-Version. Some methods to fix your problem:
Embedded resources:
|
Jabaco Source
|
1
2
|
Picture1.Picture = LabradorJpg ' you have to add Labrador.jpg as Jabaco-resource
Picture1.Refresh ' a future framework-version will refresh it automatically
|
Over HTTP:
|
Jabaco Source
|
1
2
3
|
Dim myImage As IResource = New VBImage("http://www.google.de/intl/de_de/images/logo.gif")
Picture1.Picture = myImage
Picture1.Refresh
|
Over BufferedImage:
|
Jabaco Source
|
1
2
3
4
|
Dim myJavaImage As Image = javax#imageio#ImageIO.read(New File("C:\WINDOWS\Web\Wallpaper\Labrador.jpg"))
Dim myImage As IResource = New VBImage(myJavaImage)
Picture1.Picture = myImage
Picture1.Refresh
|
Picturebox - How to load using jpg files that aren't included as IResources
Here's how I got this to work...
Be sure to include the toolkit as a resource.
Dim myImage As #Image
myImage = #Toolkit.getDefaultToolkit().getImage(PictureAddress)
Picture1.Cls
Picture1.DrawImage(myImage,0,0)