initial commit

This commit is contained in:
2019-02-08 15:56:56 +01:00
parent facdf6d6fd
commit e49c6c3517
12 changed files with 1097 additions and 105 deletions
+26
View File
@@ -5,3 +5,29 @@
#include "common.h"
#include <QBuffer>
QImage blob2Image(const QByteArray& ba)
{
QImage image;
if(!ba.isEmpty())
{
if(!image.loadFromData(ba))
myDebug << "image load error.";
}
return(image);
}
QByteArray image2Blob(const QImage &image)
{
QByteArray ba;
QBuffer buffer(&ba);
buffer.open(QIODevice::WriteOnly);
image.save(&buffer, "JPG");
buffer.close();
return(ba);
}