Re: [AD] auto convert bitmap mask to alpha channel

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Sun, 2009-07-19 at 03:02 +0200, Elias Pschernig wrote:
> 
> We could change the font loading code to understand the A4 format. If we
> don't want to hardcode any colors, then the first non-background pixel
> in the bitmap could be treated as transparency mask (if the bitmap has
> no alpha).

Still had this mail marked as important so a final reply - loading the
A4 fonts is a matter of:

ALLEGRO_FONT *load_a4_font(char const *filename)
{
    ALLEGRO_BITMAP *bitmap = al_load_bitmap(filename);
    al_convert_mask_to_alpha(bitmap, al_map_rgb(255, 0, 255));
    return al_grab_font_from_bitmap(bitmap);
}

So I don't think we need to add anything else.

-- 
Elias Pschernig <elias@xxxxxxxxxx>





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/