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.

Dark GDK / dbSetImageColorKey troubles

Author
Message
Tdawg
16
Years of Service
User Offline
Joined: 24th Nov 2007
Location:
Posted: 3rd Apr 2008 06:49
Hi, Im sure this is easy but I can't seem to get dbSetImageColorKey to work:S

I set the transparent color to white(for testing purposes) and For what ever reason the sprite still has a white background this is the code, nothing special going on just putting a couple sprites on the screen:



Ive tried putting the SetImageColorKey function before loading the image and after, im sure im missing something obvious

Thanks!
ErDa
16
Years of Service
User Offline
Joined: 17th Feb 2008
Location:
Posted: 3rd Apr 2008 13:02
It should definately be before dbLoadImage, as the commands are executed from top to bottom. Other than that, white is 255,255,255. Black is 0,0,0. =)
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 3rd Apr 2008 18:22 Edited at: 3rd Apr 2008 18:23
Tdawg
16
Years of Service
User Offline
Joined: 24th Nov 2007
Location:
Posted: 3rd Apr 2008 19:54
Thanks for the responses guys

I actually figured it out, it turns out for some reason if I remove the dbCLS(0,0,0); line of code, the color key works! now I'm just stuck with a blue screen, oh well its progress.
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 8th Apr 2008 04:52
I accidently ran into something today I wasn't aware of.

you know that dbRGB command? you pass the three collors right? It adds on a 255 ALPHA to make it fully opaque.


Not sure if this applies - but I found that out debugging something where I was having issues with tranparency etc commands not seeming to do what I thought - and once I realized how that dbRGB thing REALLY worked - I changed a line of code - and WHAM - ... Maybe its something silly like that... somehow... just rambling and sharing possibly useful info.

Later

Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 14th Apr 2008 04:17
Quote: "you know that dbRGB command? you pass the three collors right? It adds on a 255 ALPHA to make it fully opaque. "


I assumed it did something like that which is why I'm surprised that I couldn't make per-pixel alpha work in a bitmap. I may have to go back and revisit that. If per-pixel alpha was intended to work then I'd have expected to find a dbRGBA function also. It's easy enough implement

color = r + g << 8 + b << 16 + a << 24;

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 14th Apr 2008 05:05
Mine might not be the most eficient - but this is how it sits today:

jgc_rgba.h


jgc_rgba.cpp


Hope this might be useful to someone

Jason

Login to post a reply

Server time is: 2024-11-20 07:40:07
Your offset time is: 2024-11-20 07:40:07