有沒有辦法查找這種方法的實現/源代碼?它在API中需要這樣來比較兩個圖像,因爲它會覆蓋原始圖像,並且在將圖像視圖轉換爲位圖多次後,圖像看起來不再漂亮。 http://developer.android.com/reference/android/graphics/Bitmap.html#sameAs(android.graphics.Bitmap)
位圖圖像比較
我正在做這種方法從圖像創建一個位圖,並將其設置爲一個ImageView,讓用戶編輯他的圖片。
public static Bitmap getBitmap(ImageView imageView) {
BitmapDrawable mDrawable = (BitmapDrawable) imageView.getDrawable();
Bitmap b = mDrawable.getBitmap();
return b;
}
然而,在保存和從數據庫中檢索它來編輯它的好幾倍,將圖像從這個變成:
這樣:
,最後這一點:
所以我需要一種方法來檢測圖像是否沒有改變,我不重新保存這個位圖的字節數組到t他數據庫。
能否請您詳細說明,因爲我沒有幫你嗎? – 2011-05-16 11:11:52
基本上我需要一種方法來比較兩個位圖圖像,無論是逐個像素還是整個位圖。 – louieansonng 2011-05-16 11:34:10
@ louieansonng你有什麼解決方案嗎? – dipali 2015-12-21 10:12:12