Qt图片压缩

QDir baseDir("F:/algo2_4");
    QFileInfoList fileList = baseDir.entryInfoList();
    for(int i = 0 ; i < fileList.size() ; i++)
    {
        if(fileList[i].absoluteFilePath().contains("5_"))
        {
            QImage img(fileList[i].absoluteFilePath());
            QImage scale = img.scaled(img.width(), img.height(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
            scale.save(QString("C:/DRMsoft/2/%1").arg(fileList[i].fileName().replace("bmp","jpg")),"jpg");
        }


    }

你可能感兴趣的:(qt,数据库,开发语言)