i have a bitmap captured from the camera. i can place a transparent circle on the bitmap. what i’d like to do is make the circle’s pixels a new separate bitmap that is circular in shape. i have an algorithm in place that targets the circle’s pixels but how can i copy these pixels into another bitmap that is circular in shape and has the circl’s size?
public void findCirclePixels(){
for (int i=centreX-50; i < centreX+50; ++i) {
for (int y=centreY-50; y <centreY+50 ; ++y) {
if( Math.sqrt( Math.pow(i - centreX, 2) + ( Math.pow(y - centreY, 2) ) ) <= radius ){
bgr.setPixel(i,y,Color.rgb(Progress+50,Progress,Progress+100));
}
}
}
You cannot make circular bitmaps. The closest you can achieve is a square bitmap with a circular core of pixels with alpha=255 and an enclosing perimeter with alpha=0. That way, it will act as a circle when you composite it.