zoukankan      html  css  js  c++  java
  • 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;

          }

  • 相关阅读:
    pickle示例
    Python 升级致yum 问题,pip 异常
    jdk 环境
    zookeeper
    Kafka-Monitor
    Kafka
    nxlog 日志采集
    elasticsearch 基本配置
    elasticsearch 单机多实例
    Elaticsearch 集群
  • 原文地址:https://www.cnblogs.com/sode/p/2297718.html
Copyright © 2011-2022 走看看