I have to implement a function that return to me a boolean if a bitmap or canvas is empty in Android.
How I can do this ?
I have tried this solution, but it doesn't work:
Bitmap emptyBitmap = Bitmap.createBitmap(myBitmap.getWidth(), myBitmap.getHeight(), myBitmap.getConfig());
if (myBitmap.sameAs(emptyBitmap)) {
// myBitmap is empty/blank
}
How to check if a Bitmap is empty (blank) on Android
Another solution that I have considerated is:
Fastest way to check if an image is all white or all transparent
But I can't check every pixels, I spend so much time in this operation