qt_demoe/core_common/base64.h

38 lines
888 B
C
Raw Normal View History

2021-08-12 03:19:48 +00:00
#ifndef BASE64_H
#define BASE64_H
/**
* base64 :feiyangqingyun(QQ:517216493) 2016-12-16
* 1. base64
* 2. base64
* 3. base64
* 4. base64
* 5.
* 6. Qt6base64200%
*/
#include <QImage>
#ifdef quc
class Q_DECL_EXPORT Base64
#else
class Base64
#endif
{
public:
//图片转base64字符串
static QString imageToBase64(const QImage &image);
static QByteArray imageToBase64x(const QImage &image);
//base64字符串转图片
static QImage base64ToImage(const QString &data);
static QImage base64ToImagex(const QByteArray &data);
//字符串与base64互转
static QString textToBase64(const QString &text);
static QString base64ToText(const QString &text);
};
#endif // BASE64_H