0
在我的Android項目中, 這是我的代碼。如何在Android中使用字節數組獲取像素顏色
for (int x = 0; x < targetBitArray.length; x += weight) {
for (int y = 0; y < targetBitArray[x].length; y += weight) {
targetBitArray[x][y] = bmp.getPixel(x, y) == mSearchColor;
}
}
但是這段代碼浪費了很多時間。
所以我需要找到比bitmap.getPixel()更快的方式。 我想要使用從位圖轉換的字節數組獲取像素顏色,但我不能。 如何替換Bitmap.getPixel()?