Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » erasing sections of a bitmap

This thread is locked; no one can reply to it. rss feed Print
erasing sections of a bitmap
KirbyDS11
Member #15,167
June 2013
avatar

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? ???

Woops

SiegeLord
Member #7,827
October 2006
avatar

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);

"For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18
[SiegeLord's Abode][Codes]:[DAllegro5]:[RustAllegro]

KirbyDS11
Member #15,167
June 2013
avatar

Yep it worked
Thank you

Woops

Go to: