Hello,
I'm just trying to create a Qimage passing a buffer or ARGB.
So I tried this:
uchar* testB = new uchar[384*288*4];
uchar* testB = new uchar[384*288*4];
QImage image = QImage((uchar*) testB, 384, 288, QImage::Format_ARGB32);
To copy to clipboard, switch view to plain text mode
On the second line I get an error and it occurs when in the QImage constructor
I access d->depth (set on 0 at the first line):
QImage::QImage(uchar
* data,
int width,
int height, Format format
) {
d = 0;
const int depth = depthForFormat(format);
const int bytes_per_line = ((width * d->depth + 31)/32) * 4;
QImage::QImage(uchar* data, int width, int height, Format format)
: QPaintDevice()
{
d = 0;
const int depth = depthForFormat(format);
const int bytes_per_line = ((width * d->depth + 31)/32) * 4;
To copy to clipboard, switch view to plain text mode
Am I doing something wrong or it's a QT bug? (I'm using 4.2.1)
thanks
bye
Bookmarks