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 display an image?

Author
Message
Cyborg ART
17
Years of Service
User Offline
Joined: 14th Jan 2007
Location: Sweden - Sthlm
Posted: 23rd Aug 2009 21:36
Hi!

Sorry for this really basic question, but I cant seem to find the answer anywere. I have tried everything (I think )

I want to display a .jpg image on screen, I load it with:

But nothing happens, just a black screen.

The I tried to paste the image inside the loop:


and still it wont work.

Please help!

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 23rd Aug 2009 21:42 Edited at: 23rd Aug 2009 21:42
TEXTURE BACKDROP imageNum

bobbel
15
Years of Service
User Offline
Joined: 5th Jan 2009
Location: In my DBPro case xD
Posted: 23rd Aug 2009 22:03
The code you use is correct, but did you:

Put this on the really top of your code:


Call this command every loop?


that should make it work. if it doesn't, post your code here and we'll take a look at it!

Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 24th Aug 2009 01:48
Don't use .jpg either. It takes our beautifully created graphics and makes mud out of them. It changes the colors to something similar but nothing near the original. Use .png instead so you have crisp lines/colors and you can use transparencies too.

Cyborg ART
17
Years of Service
User Offline
Joined: 14th Jan 2007
Location: Sweden - Sthlm
Posted: 24th Aug 2009 19:39 Edited at: 24th Aug 2009 20:16
The texture backdrop worked!

And maybe the Sync helped too (But I used it in the code that didn't work )

Tanks!

[Edit]
I now have a .png with transperacy, but its not transperant at all.
Do I have to add something?

Cyborg ART
17
Years of Service
User Offline
Joined: 14th Jan 2007
Location: Sweden - Sthlm
Posted: 24th Aug 2009 20:18
Double post:



Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 24th Aug 2009 21:37
You need to make all that stuff around the elf and the baby carriage either a transparency (usually a white and gray checkerboard) or black (0,0,0) colored.

Ravinos
15
Years of Service
User Offline
Joined: 9th Sep 2009
Location:
Posted: 9th Sep 2009 13:59
Another questions about the LOAD IMAGE command.. i cant get it to load the image. When i compile it just gives me a dialog box that says runtime error 506 - cant load image. Any ideas? the code im using is below, thanks in advance guys.

castek
17
Years of Service
User Offline
Joined: 15th Aug 2007
Location: Right behind you!
Posted: 14th Sep 2009 19:59
is the image in the same folder as your project?

this is where my signature is supposed to be.
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 14th Sep 2009 21:02
Sorry Ravinos... sometimes when people are still in a newbie slap and they post last it doesn't update the list to show there's a new message in the thread. I saw this message as me being the last poster till Castek posted.

Castek is right. The image needs to be in the same folder as your source code... or you can add the directory to the filename to open a direct location no matter what directory your in. Like "C:\Documents\Darkbasic Pro\My Projects\logo.png" or if it's in a directory off the directory of the source code you can use "Directory Name\logo.png".

Login to post a reply

Server time is: 2024-09-28 10:29:02
Your offset time is: 2024-09-28 10:29:02