Need help about LoadAnimImage

BlitzMax Forums/BlitzMax Programming/Need help about LoadAnimImage

MacSven(Posted 2011) [#1]
Hi,

I have an Image that contains some animations. The background color is set to black
Now i want to remove the black background and set it to a transparence mode.
Is this with animimages possible?


GfK(Posted 2011) [#2]
Yes. Images are loaded with the MASKEDIMAGE flag by default, so you don't need to do anything there.

Use SetBlend MASKBLEND before drawing the image and that should do it. Note though, that you will get hard edges where the black stops, and the other colours start, so it will probably look pretty ugly.

I'd recommend using Paintshop or whatever to remove the black parts, and leave them transparent. Save as PNG24 with alpha channel, then just use SetBlend ALPHABLEND before drawing. Much better results that way.


MacSven(Posted 2011) [#3]
I tasted it on MacOS X but nothing happend:

Example:


Incbin "geo_font.png"
Global fontImg:TImage=LoadAnimImage("incbin::geo_font.png",FontWidth,FontHeight,0,FontFrames)




Jesse(Posted 2011) [#4]
incbin is case sensitive make sure all of the letters match exactly in the file name, in the incbin declaration and in the loading function.
also make sure it is in the same directory as your program but I am sure you knew that.

Last edited 2011