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 / HELP - Paste Image driving me nuts

Author
Message
The Naked Duck
15
Years of Service
User Offline
Joined: 19th Feb 2011
Location:
Posted: 19th Feb 2011 16:04
I am pretty new to this but have programmed a bit before at uni. I am trying to get into DBPro and can not seem to load and paste an image to screen while getting to grips with the basics. I have been through all the forums/threads and nothing gives me a path of light! Code:

Load image "media\Grat-Pat1.bmp",1
paste image 1, screen width()/2, screen height()/2

suspend for key

I have upgraded to U76 and tried it before the update witht he version from the DVD. All I get is a black screen until I pres a key. I have tried loading lots of different images including those that come with DBPro. All produce the same. I am running Vista SP2 and have ensured there is no AV conflict with Norton.

I have been able to create objects and move the camera among other things but this stumps me. The only compile error I get is:

No icon is specified for the final exe

I have ensured theimage file is in the media folder and saved the DBPro file adn project first. I have tried using Sync and that has no effect. Am I doing something really dumb or is DBPro on it's own agenda?
enderleit
19
Years of Service
User Offline
Joined: 30th May 2007
Location: Denmark
Posted: 19th Feb 2011 21:33 Edited at: 19th Feb 2011 21:37
The No icon "error" is actually a warning, and doesn't really matter... It just means that you haven't applied a custom ICON to your executable...

About the code... I can see no errors... But try this:



Replace "image.bmp" with an image file you have...

EDIT: I have never used the SUSPEND FOR KEY command, I normally use WAIT KEY, but can't see any difference in the manual between the two commands... You might wanna try your own code and use WAIT KEY instead to see if that makes any difference...

Tone Dialer
Valued Member
20
Years of Service
User Offline
Joined: 17th Oct 2005
Location: England, well a town in it !
Posted: 19th Feb 2011 21:40 Edited at: 19th Feb 2011 21:41
Hi, welcome to the forums.

Try a full path for the image file you are using..eg.



Also you can test if the image exists with the path you are using if you use IF FILE EXIST (returns a 1 if the file exists, 0 otherwise).

Please use
when giving code examples.

sadsack
22
Years of Service
User Offline
Joined: 27th Nov 2003
Location: here
Posted: 20th Feb 2011 15:58
Try putting your image in the same folder that you DBP file are, use no path.
a path is going to give you a problem, if you are going to let other people put the game on there computer.
renny

Life is not fair, so deal with it.
http://www.gusroundtable.com/
Jeff Miller
21
Years of Service
User Offline
Joined: 22nd Mar 2005
Location: New Jersey, USA
Posted: 20th Feb 2011 16:53
After the paste image command, use the sync command before you await a key-press, as in enderleit's example.

Login to post a reply

Server time is: 2026-07-17 13:59:12
Your offset time is: 2026-07-17 13:59:12