安卓判断bitmap是否相等
public static boolean isSameBitmap(Bitmap bitmap1, Bitmap bitmap2) {
ByteBuffer buffer1 = ByteBuffer.allocate(bitmap1.getHeight() * bitmap1.getRowBytes());
bitmap1.copyPixelsToBuffer(buffer1);
ByteBuffer buffer2 = ByteBuffer.allocate(bitmap2.getHeight() * bitmap2.getRowBytes());
bitmap2.copyPixelsToBuffer(buffer2);
boolean equals = Arrays.equals(buffer1.array(), buffer2.array());
Log.d("ZHJ++", "zhj isSameBitmap: " + equals);
return equals;
}
本文标题:安卓判断bitmap是否相等
本文链接:https://www.haomeiwen.com/subject/eycdcjtx.html
网友评论