Thank you for reply. i am here attaching my code. please suggest me which type of buffer i should take in order to save rgba formate.
#include "image_rw.h"
#include "ui_image_rw.h"
#include <QFile>
#include <QBuffer>
#include <QDebug>
namespace
{
const char* MINI_IMAGE = ":/mini.jpg";
}
image_rw
::image_rw(QWidget *parent
) : ui(new Ui::image_rw)
{
ui->setupUi(this);
this->setAttribute( Qt::WA_TranslucentBackground );
this->setWindowFlags(Qt::FramelessWindowHint);
image.load(MINI_IMAGE);
QImage img
= image.
convertToFormat(QImage::Format_RGBA8888,Qt
::AutoColor);
img.save(&bufferrgb, "RGBA8888");
img.save(":/image1.rgba","RGBA8888");
img.format();
qDebug() << img.format() << endl;
}
#include "image_rw.h"
#include "ui_image_rw.h"
#include <QFile>
#include <QBuffer>
#include <QDebug>
namespace
{
const char* MINI_IMAGE = ":/mini.jpg";
}
image_rw::image_rw(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::image_rw)
{
ui->setupUi(this);
this->setAttribute( Qt::WA_TranslucentBackground );
this->setWindowFlags(Qt::FramelessWindowHint);
QImage image;
image.load(MINI_IMAGE);
QImage img = image.convertToFormat(QImage::Format_RGBA8888,Qt::AutoColor);
QByteArray im;
QBuffer bufferrgb(&im);
bufferrgb.open(QIODevice::WriteOnly);
img.save(&bufferrgb, "RGBA8888");
img.save(":/image1.rgba","RGBA8888");
img.format();
qDebug() << img.format() << endl;
}
To copy to clipboard, switch view to plain text mode
its giving me no 17 in terminal. but no image get save in folder.
thank you in advance.
Bookmarks