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 / Newbie question about adding pics to my program

Author
Message
Sierra117
15
Years of Service
User Offline
Joined: 19th Apr 2011
Location:
Posted: 19th Apr 2011 11:17
I am new to this, but so far I am getting the hang of everything I have tried. I am using a mix of the help topics in DB Pro and a book I picked up. The one thing that I cannot figure out is how to load pictures into my project. I put the desired pic into the folder that I have my .dba and .dbpro files in and I thought I had the code right, but it either won't display or gives me an error message. Here is a pic of the message I get:


Any help on this would be greatly appreciated! Thank you all.
Hodgey
16
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 19th Apr 2011 14:10
Hi Sierra and welcome to the forums. I think I can see the media tab there to the left so try clicking the folder icon under that tab and then opening the image(s) from that folder. Then try compiling.

Note: You know it will have opened the media in your dbpro project successfully if the name of the image appears under the media tab. Also make sure this name matches exactly to the one you are loading in your code.

A clever person solves a problem, a wise person avoids it - Albert Einstein
Agent
21
Years of Service
User Offline
Joined: 7th Sep 2004
Location: Sydney, Australia
Posted: 19th Apr 2011 17:05
Hey Sierra,

The problem you're experiencing can be a little confusing. The command you want to use if you're loading an image file (any image file, from PNG to JPG and yes, BMP) is LOAD IMAGE, as such:

LOAD IMAGE "filename.bmp", imagenumber, textureflag

The LOAD BITMAP command is also used to load .bmp files but the term bitmap has a specific meaning in DBPro that is a lot more advanced than displaying simple images on the screen.

If your goal is to load an image and display it on the screen, use LOAD IMAGE, even if the file you're loading is a .bmp. It's a little counter-intuitive if you're new, but LOAD BITMAP is not a command you'll be using anytime in your beginning stages.

Login to post a reply

Server time is: 2026-07-18 06:41:18
Your offset time is: 2026-07-18 06:41:18