Open razgrizbw opened 9 years ago
The performance will have much improve if using Bitmap.getpixels in getScratchedRation()
replace the code with
final int width = mScratchedTestBitmap.getWidth(); final int height = mScratchedTestBitmap.getHeight(); int[] pixels = new int[width*height]; mScratchedTestBitmap.getPixels(pixels, 0, width, 0, 0, width, height); for (int i=0;i<pixels.length;i++) { if (0 == Color.alpha(pixels[i])) { count++; } } float completed = (float) count / ((width / speed) * (height / speed)) * 100; return completed;
The performance will have much improve if using Bitmap.getpixels in getScratchedRation()
replace the code with