Set transparency color

Monkey Forums/Monkey Programming/Set transparency color

zoqfotpik(Posted 2012) [#1]
Is there any way in monkey to set a color you want to be transparent as an RGB value, so that when drawing an image with that color, it will not draw pixels of that color?

Does anyone know how in Blitzmax to write PNG files including transparent pixels?


Raz(Posted 2012) [#2]
Not not aware that Monkey has colour masking. However there are free tools out there that will let you save PNG's with transparency.

GIMP - http://www.gimp.org/
Paint.NET - http://www.getpaint.net/


zoqfotpik(Posted 2012) [#3]
I'm aware of that but I need to do it automatically. I wonder if I could hack Mojo to provide a DrawImageTransparent that would check to see if a given RGB value matched hot magenta and then not draw that pixel...


Gerry Quinn(Posted 2012) [#4]
Mojo is too high-level to do that. You'd have to find a way of doing it on target platforms, and then hack mojo to access that method.


vbnz(Posted 2012) [#5]
zoqfotpik,
Does anyone know how in Blitzmax to write PNG files including transparent pixels?

Use MaskPixmap command with zero values of masks.
You can see the code in your mojo folder-makefont.bmx.