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.

DarkBASIC Professional Discussion / Loading a image into Dark Basic Pro

Author
Message
omega120
18
Years of Service
User Offline
Joined: 15th Jul 2006
Location:
Posted: 15th Jul 2006 16:00
When I enter Dark Basic Pro editor and type the following 4 lines:-

load image "image.bmp",1
do
sprite 1,300,200,1
loop


a error is displayed saying it cant load the image, can anyone help me to get a image from my `c` drive loaded into Dark Basic Pro so I can display a sprite from the image(by the way the image for the sprite is "image.bmp" from Dark Basic Pro folder in `programs` in `c` drive under `sprite`).Thanks.
The Nerd
20
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 15th Jul 2006 16:17 Edited at: 15th Jul 2006 16:22
Do you remember to put "image.bmp" in the same folder as your exe? Or in any other place, as long as you define the right path when you load the image. If you wanted to load an image from the c drive, it would be something like:


etc...

And you don't need to put the sprite command in the loop. You can just do like this:


RUCCUS
20
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 15th Jul 2006 17:36
You need a sync to refresh the screen.

do
sync
loop

Chris Franklin
19
Years of Service
User Offline
Joined: 2nd Aug 2005
Location: UK
Posted: 15th Jul 2006 18:27
er i don't know if this is what ya want but o well might be



Platformer Compo!
WHITEKNUCKLE IS BACK! Check the wip boards for more info
omega120
18
Years of Service
User Offline
Joined: 15th Jul 2006
Location:
Posted: 15th Jul 2006 19:22
I still cant get this listing to work I typed in the editor

load image "image.bmp",1
sprite 1,300,200,1
do
loop


and the same thing happens everytime I click on exe icon at the top
and the error is displayed

`Runtime error 506 - could not load image at line 1`

I have created with Pro Motion an image and placed it on my desktop I just cant get Dark Basic Pro to load the image.
Please help me anyone............
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 15th Jul 2006 20:13 Edited at: 15th Jul 2006 20:16
Quote: "and placed it on my desktop "

There's an issue!
Quote: "Do you remember to put "image.bmp" in the same folder as your exe?"

Did you even read that?

Okay, that's one problem. One more is that you probably haven't even saved your project yet, so you cannot load anything, because it is trying to load from something that doesn't even exist. SAVE your code in a folder, then put "Image.bmp" in that folder. To save, click FILE while you're in DBPRo, then Save Project or Save Source (TO just save the code, use Save Source)

Remember what I just told you

=Hope you were listening...

My Functions: Mine
Post yours: Post
DVader
21
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 15th Jul 2006 20:20
You need a sync in it.

Try
sync on
sync rate 0
load image "image.bmp",1
do

sprite 1,300,200,1

sync
loop
NeX the Fairly Fast Ferret
20
Years of Service
User Offline
Joined: 10th Apr 2005
Location: The Fifth Plane of Oblivion
Posted: 15th Jul 2006 20:29
Wow, you should try getting a tilemap to load into HAM correctly. THAT is difficult, not putting a bmp into the project directory. You did make a project, didn't you?


Since the other one was scaring you guys so much...
omega120
18
Years of Service
User Offline
Joined: 15th Jul 2006
Location:
Posted: 15th Jul 2006 20:30
Ok where is the folder for exe there is no sign where the exe folder is in Dark Basic Pro manual I am complete at a loss.HELP.......
Gil Galvanti
20
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 15th Jul 2006 23:49
it means that its the wrong directory. Save your project, copy and paste that image/save it to that directory (same folder as your project), then use your code.

Pirates of Port Royale
Live the life of a pirate.
Storm 6000
20
Years of Service
User Offline
Joined: 10th Oct 2004
Location:
Posted: 16th Jul 2006 05:13
open the dbpro directory then gointo projects it will be in there if you saved it as a projetc if not start again and save it as a project

Thanks
Adam
Zotoaster
20
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 16th Jul 2006 05:25
Or, use the 'Set Dir' command, and set the directory to your desktop, like 'Set Dir "Blah Blah/Desktop"', then just use 'load image'

Aaron Miller
19
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 16th Jul 2006 09:48
Umm... You don't need to sync, you only need to sync when the "sync on" command is used, i have done things like that before and they have worked for me. Also, try using the media manager, check the box "Copy to this folder" and get the image from the desktop. It will now be included in your EXE, and you can make sure you are spelling the name correctly.

Game Developer!
http://www.freewebs.com/geniesoftware/gamedeveloper
Be Ruler of your World...

Login to post a reply

Server time is: 2025-05-21 04:59:40
Your offset time is: 2025-05-21 04:59:40