Transparent GIF, how to make it?
BlitzMax Forums/BlitzMax Beginners Area/Transparent GIF, how to make it?
| ||
Can any1 plz tell me how to make a transparant GIF? I painted a 2-color rocket using the windowsXP Paint application. The background is red, the rocketshape is painted in white. I have saved the image as a GIF, however when using it in my programcode the rocket is enclosed in a red block. How can i make the red color transparent, so that when i move the rocket over a (black) background then the red wont show? Which (freeware/demoware) paintprogram can make transparent GIFs? TIA |
| ||
1) How are you loading the GIF into Bmax? 2) Setmaskcolor r,g,b, then load the image. 3) The Gimp : definately. Pixia (I think), Dogwaffle, Ultimate Paint : possibly. |
| ||
4) use .png instead :) |
| ||
Which (freeware/demoware) paintprogram can make transparent GIFs? The GIMP & Irfanview.But yeah. Use PNG instead. |
| ||
Is there any option, or clicking of sumthing to do, to make a background area transparent? Must i select a color? I am using a PNG-image, loading using the LoadImage.. like this: objSpeler1.image = TImage(LoadAnimImage("media/Raketa01_anim.PNG", 161, 79, 0, objSpeler1.AnimFrames, MASKEDIMAGE)); full code.. Function CreatePlayer:clsSpelGameObject() Const METHOD_NAME:String = "CreatePlayer"; Try objSpeler1 = clsSpelGameObject.create(); objSpeler1.AnimFrames = 7; '//animaframes heeft een 0-index. objSpeler1.image = TImage(LoadAnimImage("media/Raketa01_anim.PNG", 161, 79, 0, objSpeler1.AnimFrames, MASKEDIMAGE)); Catch objErr1:Object Throw(" Fout in '" + METHOD_NAME + "' --> " + objErr1.toString()) EndTry Return objSpeler1; End Function TIA! |
| ||
If it's an alpha-transparency then use alphablend when drawing the image. If it's a mask color define it use setmaskcolor. |
| ||
We as humans have the programming to recognise which areas of colour are "the background" There is no little gnome that can do that inside your computer, computers are stupid creatures that can only do exactly what we tell them to do, and immediatly screw up as soon as anything is open to interpritation So yes, you have to say the colour, it cant just select which one is the background on its own Also, use .png, it is a far better image format created to replace .gif (PNG = Probably Not Gif :p) |