bool GetIcon(const QString &name1, const QString &name2){ QImage im1 = QImage(name1+".jpg"); QImage im2 = QImage(20, 35, im1.format()); for(int x=0; x<20; x++) for(int y=0; y<35; y++) im2.setPixel(x,y, im1.pixel(x,y)); im2.save(name2+".jpg"); for(int x=0; x<im1.width(); x++) for(int y=0; y<im1.height(); y++) if(im1.pixel(x,y) == im2.pixel(1,1)) { //qDebug() << name1; for(int x1=x, x2=1; x2<im2.width(); x1++, x2++) for(int y1=y, y2=1; y2<im2.height(); y1++, y2++) if(im1.pixel(x1,y1) != im2.pixel(x2,y2)) return false; return true; } return false;}bool test1(const QString &name1, const QString &name2){ QImage im1 = QImage(name1+".jpg");//.convertToFormat(QImage::Format_RGB888); QImage im2 = QImage(name2+".jpg");//.convertToFormat(QImage::Format_RGB888); for(int x=0; x<im1.width(); x++) for(int y=0; y<im1.height(); y++) if(im1.pixel(x,y) == im2.pixel(1,1)) { //qDebug() << name1; for(int x1=x, x2=1; x2<im2.width(); x1++, x2++) for(int y1=y, y2=1; y2<im2.height(); y1++, y2++) if(im1.pixel(x1,y1) != im2.pixel(x2,y2)) return false; return true; } return false;}int main(int argc, char** argv){ qDebug() << GetIcon("1", "11"); qDebug() << test1("1", "11");}