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 / Transparency For Images

Author
Message
Cooldude
17
Years of Service
User Offline
Joined: 10th Nov 2007
Location:
Posted: 23rd Nov 2007 03:51
I am working on making an FPS Game and have designed a JPEG Crosshair image. I have the cross hair made red and everything else black. I want to make the black part transparent. Hor do I do that???
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 23rd Nov 2007 14:36
You don't with jpegs, at least not very well - the edges will be fuzzy at best.

Instead, try using a PNG or TGA which have transparency built in, or use a bitmap where you can use the dbSetImageColorkey to state that black is transparent.

Utility plugins collection and
http://www.matrix1.demon.co.uk for older plug-ins and example code
dbGamerX
16
Years of Service
User Offline
Joined: 23rd Nov 2007
Location:
Posted: 24th Nov 2007 05:16
Hmm, well, use a tool like Paint.NET (http://www.getpaint.net/) and open the crosshair JPEG with it. Save the crosshair in a different format like PNG. Then use the magic wand tool and set the tolerance to 0. Click on the black areas and press the Delete key. Finally, save and move the image to your projects folder for use

Note: the checkerboard (if you are using Paint.NET) area is the transparent part.

dbPrint ( "Sig" );
Cooldude
17
Years of Service
User Offline
Joined: 10th Nov 2007
Location:
Posted: 26th Nov 2007 16:17
Thanks,
I got paint.net!!! It works great.

Login to post a reply

Server time is: 2024-11-19 17:29:15
Your offset time is: 2024-11-19 17:29:15