Lele
11th January 2007, 10:56
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];
QImage image = QImage((uchar*) testB, 384, 288, QImage::Format_ARGB32);
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)
: QPaintDevice()
{
d = 0;
const int depth = depthForFormat(format);
const int bytes_per_line = ((width * d->depth + 31)/32) * 4;
Am I doing something wrong or it's a QT bug? (I'm using 4.2.1)
thanks
bye
I'm just trying to create a Qimage passing a buffer or ARGB.
So I tried this:
uchar* testB = new uchar[384*288*4];
QImage image = QImage((uchar*) testB, 384, 288, QImage::Format_ARGB32);
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)
: QPaintDevice()
{
d = 0;
const int depth = depthForFormat(format);
const int bytes_per_line = ((width * d->depth + 31)/32) * 4;
Am I doing something wrong or it's a QT bug? (I'm using 4.2.1)
thanks
bye