Qt 图片转Base64字符

QImage image(ImgPath);
QByteArray ba;
QBuffer buf(&ba);
image.save(&buf, "PNG", 20);
QByteArray hexed = ba.toBase64();
QString str = QString::fromLocal8Bit(MDString(hexed.data()).c_str());
buf.close();

posted on 2017-01-19 15:46  阿兴的平凡世界  阅读(1202)  评论(0)    收藏  举报

导航