Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / cant load image...am I that stupid?

Author
Message
TrueMOD
21
Years of Service
User Offline
Joined: 12th Sep 2003
Location:
Posted: 2nd Aug 2007 23:01
Ok its been a long long long time I used DBPro but now I returned since Im in mood to write some new little game. Before I gave up using DBPro because it was really buggy and I never knew if it was my fault or DBPro's fault when a program didnt work.
Now I installed DBPro again and updated to the lates version which as far as I know is 6.6
I also updated the editor to latest version.
Now I wanted to start really simple...and check out things to get used to DBPro again...


well yeah as you can see this code is really small and was just for testing purposes. Now it gives me the error that the image could not be loaded.
I thought it might be because of a typo...but checked and it was not
I thought it might be because of the PNG format...changed to bmp, tga and whatever...it was not
I thought it might be because of the folder specified in filename "gfx/..." so I put it in the main folder...it was not
I really dont know whats wrong here and I feel a little bit stupid not being able to load a simple image since I wrote full applications with DBPro already long time ago...or is this a DBPro bug again?


Thanks in advance...


Ben
vorconan
17
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Wales
Posted: 2nd Aug 2007 23:44
just use load image "gfx/mainchar.png",1 and see if that makes a difference


TrueMOD
21
Years of Service
User Offline
Joined: 12th Sep 2003
Location:
Posted: 3rd Aug 2007 00:02
nope doesnt make a difference

runtime error 506 - couldnt load image at line x
TrueMOD
21
Years of Service
User Offline
Joined: 12th Sep 2003
Location:
Posted: 3rd Aug 2007 00:11
sorry for the double post but couldnt find an edit button (its late here maybe am blind)

I found the "bug"
I set this ones program folder to be a completely different than the usual project folder DBPro uses...now DBPro kinda didnt care and created it in the default projects folder as well (double creation?) and used this as work folder...there of course I didnt have the gfx since I thought DBPro will use the folder specified when I created a new project...

Thanks for trying to help though!
Zeus
18
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 3rd Aug 2007 04:25
Put it in the project's folder. Did you put it there?

Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 3rd Aug 2007 20:39
Try running the EXE from outside the IDE. I had a problem recently where if I ran it from the IDE it'd give me the same error.

Tempest (DBP/DBCe)
Multisync V1 (DBP/DBCe)
Commander in Chief
18
Years of Service
User Offline
Joined: 15th Apr 2006
Location: Carbondale, PA, USA
Posted: 3rd Aug 2007 20:53
Here is how your folder structure should work:

ProjectFolder/MyProject.dbpro
ProjectFolder/MyProject.dba
ProjectFolder/gfx/mainchar.png

Hope I helped.
~Chief

Hardware: nVidia GeForce 8500GT 256mb, 240gb HD Space, Pentium 4 CPU 2.80GHz, 512mb RAM, Realtek HD Audio
Software: 3Ds Max 9, Adobe Photoshop CS8
Daemon
18
Years of Service
User Offline
Joined: 16th Dec 2005
Location: Everywhere
Posted: 3rd Aug 2007 21:38
You may have the same problem as this person.

Link

Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 4th Aug 2007 01:02 Edited at: 4th Aug 2007 01:02
I've just realised that media is loaded relative to the location of the project/source file when the EXE is run from the IDE, this might only occur with the default IDE however.

Tempest (DBP/DBCe)
Multisync V1 (DBP/DBCe)
Alquerian
18
Years of Service
User Offline
Joined: 29th Mar 2006
Location: Reno Nevada
Posted: 4th Aug 2007 18:53
Try this:


Visit the Wip!
tikki
17
Years of Service
User Offline
Joined: 1st Aug 2007
Location:
Posted: 5th Aug 2007 05:23
i am to having the same problem
i tried Alquerian's code but i still get an error (yes i changed path and used my appropriate file name ). i tried "exe with attached media" but that didn't work either. please help

RAWR!
andrey d
17
Years of Service
User Offline
Joined: 30th Jun 2007
Location:
Posted: 7th Aug 2007 05:29
I come across this every single time when I program. The only way for me to run anything is to actually run the executable itself, that's the only thing that did the trick for me. Any type of media and DBPro goes crazy.
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 7th Aug 2007 06:26
Quote: "The only way for me to run anything is to actually run the executable itself, that's the only thing that did the trick for me"

I think I know the cause of this. When you load an EXE from an application (in this case the IDE) it is possible to specify the 'working directory' for it, which is where by default it will look for files in. I've noticed that when I run the EXE from the IDE, I have to specify paths for media that are relative to the project/source files, which to me says that the IDE is setting the EXE's working directory to that of the project/source files. This doesn't happen when you run the EXE externally as the default working directory is where the EXE is.

Tempest (DBP/DBCe)
Multisync V1 (DBP/DBCe)
Kieran
18
Years of Service
User Offline
Joined: 6th Aug 2006
Location: Hamilton, New Zealand
Posted: 8th Aug 2007 10:23
I found that when that junk happens, you make a new project and copy/paste the code over and then it works again. I have no idea why.

It doesn't matter where the files are as long as you have the appropriate filepath.

Generally I find it easiest to have

Projects/MyProject/project.dbpro
Projects/MyProject/Media/...PNG

or something along those lines but its up to you really.

Login to post a reply

Server time is: 2024-09-27 02:23:58
Your offset time is: 2024-09-27 02:23:58