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 / how do i "load bitmap"

Author
Message
Dirk
20
Years of Service
User Offline
Joined: 26th Dec 2003
Location:
Posted: 26th Dec 2003 09:34
i keep getting "file does not exist" everytime i type in the code from tutorial 6:photocopier. I did a find on "sample.bmp" and could not find it so i used "floor.bmp" and same error result.
any ideas?

thanks
ReD_eYe
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 26th Dec 2003 12:22
the bitmap(.bmp) file that you want to load has to be in the same folder as your saved .dba file.


GO TO THE ETERNAL DESTINY FORUMS!!! http://forums.eternaldestinyonline.com
Do it now!!!
zircher
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 26th Dec 2003 19:09
The load bitmap command supports relative and absolute file paths.

If you try:

load bitmap "test.bmp", 1

DBP is going to assume that you mean relative to the program.

This would allow you to get the image from a subdirectory.

load bitmap "media\test.bmp", 1

And, you can 'hard code' the path as well.

load bitmap "c:\dbpro\projects\mygame\media\test.bmp", 1

Most people recommend relative paths since your game could be installed anywhere and relative paths are more flexible.
--
TAZ
Dirk
20
Years of Service
User Offline
Joined: 26th Dec 2003
Location:
Posted: 26th Dec 2003 20:24
thanks for the quick reply. it worked perfectly.
what does the ",1" do?

thanks
BearCDPOLD
20
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 26th Dec 2003 23:15
DarkBASIC has to have a way to keep track of all the bitmaps you load into memory, otherwise your computer will just crash, burn, and die from use of it. The 1 is the bitmap number. You can have up to 32 bitmaps, and 65000 images from LOAD IMAGE.

Juvenile Industries
Current Project: The First Room (FPS)
Soon to come:An rts, and a snowball fight game
zircher
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 27th Dec 2003 02:51
JI nailed it. The number is simply a ID number that the programmer assigns. They don't even need to be sequential.
--
TAZ

Login to post a reply

Server time is: 2024-09-21 15:16:38
Your offset time is: 2024-09-21 15:16:38