I want to convert a "sky.png" image into base 64 format in cpp using Qt. I found the following code in Qt documentation, but don't get how to get the base 64 format. How to convert image into base 64 format?
QImage image;
QByteArray ba;
QBuffer buffer(&ba);
buffer.open(QIODevice::WriteOnly);
image.save(&buffer, "PNG");
qDebug()<<"buffer"<<&buffer;
Bro, you are almost there: you just need to: write the image into the buffer and then from the buffer get the data as Bse 64...
like: