erasing sections of a bitmap
KirbyDS11

Hi
I was wondering how you would erase a circle or a rectangle out of a bitmap.

#SelectExpand
1if(al_is_bitmap_locked(land)) 2{ 3 al_unlock_bitmap(land); 4} 5al_set_target_bitmap(land); 6al_draw_filled_circle(centerx,centery,radius,al_map_rgba(0,0,0,0)); 7al_set_target_bitmap(al_get_backbuffer(display));

this does not work but would it be something similar to this but with something else added in? ???

SiegeLord

Something like this should work:

al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO);
al_draw_filled_circle(centerx,centery,radius,al_map_rgba(0,0,0,0));
al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_INVERSE_ALPHA);

KirbyDS11

Yep it worked
Thank you

Thread #612876. Printed from Allegro.cc