android 简单比较 两个图片是否一致

引用:http://www.linuxidc.com/Linux/2011-09/43131.htm

 // 简单的比较两个图像是否一致

    private boolean compare2Image(Bitmap bmp1,Bitmap bmp2)

    {

          int iteration = 0;

          int width = bmp1.getWidth();

          int height = bmp1.getHeight();

          if(width != bmp2.getWidth()) return false;

          if(height != bmp2.getHeight()) return false;

   

          if(width < height)

          {

                iteration = width;

          }

          else

          {

                iteration = height;

          }

           

          for(int i = 0; i < iteration; ++i)

         {              

                if(bmp1.getPixel(i, i) != bmp2.getPixel(i,i)) return false;

          }

          return true;

      }

原文地址:https://www.cnblogs.com/sode/p/2297718.html