qt_demoe/base64helper/base64helper.h

38 lines
936 B
C
Raw Normal View History

2021-09-16 06:48:38 +00:00
#ifndef BASE64HELPER_H
#define BASE64HELPER_H
2021-08-12 03:19:48 +00:00
/**
* base64 :feiyangqingyun(QQ:517216493) 2016-12-16
2021-09-13 08:12:35 +00:00
* 1. base64
* 2. base64
* 3. base64
* 4. base64
* 5.
* 6. Qt6base64200%
2021-08-12 03:19:48 +00:00
*/
#include <QImage>
#ifdef quc
2021-09-16 06:48:38 +00:00
class Q_DECL_EXPORT Base64Helper
2021-08-12 03:19:48 +00:00
#else
2021-09-16 06:48:38 +00:00
class Base64Helper
2021-08-12 03:19:48 +00:00
#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);
};
2021-09-16 06:48:38 +00:00
#endif // BASE64HELPER_H