It seems drawing PNG images with support for alpha-transparency isn't supported. This is kind of annoying, since my miniwindows have variable borders (dependant on the area), and the images I have produce strange results no matter what way I try to draw them. (Or they look plain weird. ^^) Probably because of alpha-transparency being used to block colours out and such.
I could manually convert them to BMP, but then I lose the funky alpha-transparency when drawing them, which is kind of nice. Since you are already using libpng, I imagine you convert them to BMP in memory, causing the funky result. On top of that, there is no real way to use PNG images to their full advantage.
What the best way is to implement 'real' PNG support with MUSHclients current API I am not sure. You could add an 'asSource' parameter to WindowLoadImage that would prevent conversion to BMP, and only perform the conversion to BMP once it is needed (blendimage and such come to mind). Or you could try to handle it fully transparentially. I reckon libpng has some really simply drawing routines though, if only the basic draw and stretchclipped draws, so the 'transparentially' thing can be accomplished I think.
Alternatively, which would be simpler, you could make a separate LoadPNG and DrawPNG functions, although that could get a bit ugly.
(P.S.: Nick, I know I still promised in another thread to.. do something which escapes me right now. Life's been busy, although I do know I promised. ^^) |