How do you cut (remove) a section from a bitmap??? I want that section/shape to be removed.. leave transparent in place of section.. Say shape is cercle or square..
: a mobile robot usually with a human form. sci-fi androids.
Generally, though, iOS devices are faster and smoother than most Android phones at comparable price ranges. For example, an iPhone 14 can perform nearly as well as the highest-end iPhone, and it starts at $799 MSRP. Even the budget iPhone SE is a great performer.
The Android operating system is a mobile operating system that was developed by Google (GOOGL) to be primarily used for touchscreen devices, cell phones, and tablets.
Android Inc., was bought by the American search engine company Google Inc., in 2005. At Google, the Android team decided to base their project on Linux, an open source operating system for personal computers.
You should be able do this with a Porter-Duff color filter and a Canvas
:
public void punchHole(Bitmap bitmap, float cx, float cy, float radius) {
Canvas c = new Canvas(bitmap);
Paint paint = new Paint();
paint.setColorFilter(new PorderDuffColorFilter(0, PorderDuff.Mode.CLEAR));
c.drawCircle(cx, cy, radius, paint);
}
Well, that was wrong. However, using a Porter-Duff transfer mode does work:
public void punchHole(Bitmap bitmap, float cx, float cy, float radius) {
Canvas canvas = new Canvas(bitmap);
Paint paint = new Paint();
paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.CLEAR));
canvas.drawCircle(cx, cy, radius, paint);
}
(The bitmap passed as an arg needs to be modifiable, of course.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With