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 / Load Bitmap, transparency?

Author
Message
Euphoria
18
Years of Service
User Offline
Joined: 21st Feb 2006
Location: United Kingdom
Posted: 29th Mar 2006 00:53 Edited at: 29th Mar 2006 00:53
Hi,

I am trying to grab sprites from a single .png file for use as a sprite font (see attached image file), I thought I would just use LOAD BITMAP, then GRAB IMAGE....

Whilst everything works fine it seems that the LOAD BITMAP command removes any transparency for the image so everything ends up with a white background

I've checked the image and its fine (I have attahced it to the post incase), I even used load image to load the whole thing in and stamp it as a sprite to the screen, all tranparency was preserved ok.....its just when using LOAD BITMAP

Is this the wrong way to grab images and preserve the transparency?

The test code I am using is:



Gives me a white background to the sprite (no transparency)(

whereas (and this was just to check that DBP could recognise the tranparency)



preserves the tranparency fine...

Am I doing something obviosuly wrong? Or perhaps this is not the use for load bitmap

Any help would be apreciated


thanks

PS.Using DBPro, ta

Attachments

Login to view attachments
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 29th Mar 2006 09:56
Both myself and BatVink have code snippets that will grab images whilst retaining transparency ... search the code snippets for them.

Alternatively, if you have the latest update of DBP then add this
near the beginning of your code (before any other bitmap commands) and the add a parameter '2' to the end of the grab command and that should work also

eg:



Euphoria
18
Years of Service
User Offline
Joined: 21st Feb 2006
Location: United Kingdom
Posted: 29th Mar 2006 15:01
Thanks for the reply scraggle.

I apreciate the work around options, and will give them ago. This seemed like the obvious way to do this hence I wondered if its a flaw in the bitmap commands or my usage of them.

When you say the latest version is that U6 or just the latest 'stable' version (5.9)? I am still learning so didn't think I would jump into a beta version hence I'm using 5.9


cheerz
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 29th Mar 2006 15:27
It is very new, 5.9 doesn't have the functionality.
If you are still using 5.9 and don't want to upgrade you will have to use the memblock routines.


Login to post a reply

Server time is: 2024-11-27 23:40:42
Your offset time is: 2024-11-27 23:40:42