标签:
以二进制流 写入加密二进制串+Image = 新文件
解密时 读取同样长度的二进制+Image 即可解密
新文件,新思维
QImage image("philip.png");
QMap<QString, QColor> map;
map.insert("red", Qt::red);
map.insert("green", Qt::green);
map.insert("blue", Qt::blue);
QFile file("facts.dat");
if (!file.open(QIODevice::WriteOnly)) {
std::cerr << "Cannot open file for writing: "
<< qPrintable(file.errorString()) << std::endl;
return;
}
QDataStream out(&file);
out.setVersion(QDataStream::Qt_4_3);
out << quint32(0x12345678) << image << map;
标签:
原文地址:http://www.cnblogs.com/lzh-Linux/p/4458225.html