You are not logged in.

Diegoba

Beginner

  • "Diegoba" is male
  • "Diegoba" started this thread

Posts: 2

Date of registration: Dec 22nd 2008

Location: Uruguay

  • Send private message

1

Monday, December 22nd 2008, 2:47am

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

Manuel

Administrator

  • "Manuel" is male

Posts: 256

Date of registration: Jul 16th 2008

Location: Erlangen, Germany

Occupation: Software Developer

Hobbies: Jabaco, game theory, text-mining

  • Send private message

2

Wednesday, December 31st 2008, 5:22pm

Quoted

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.

Quoted

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

JCato

Beginner

  • "JCato" is male

Posts: 4

Date of registration: Jan 3rd 2009

Location: Meridian, MS USA

Occupation: Manager

Hobbies: Martial Arts

  • Send private message

3

Wednesday, January 7th 2009, 2:24am

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)

Rate this thread
WoltLab Burning Board