Hi everybody,
I am working on a software that is using an active x control. The active x has function that return a bitmap as QVariant, tha Qvariant Type is QvariantList, and the item type inside the list are reconigzes as int.
The Function is suppose to return this information wrap in a variant:
- BitmapInfoHeader: (WINDOWS BITMAPINFOHEADER sturct);
- Palette 256 element arrayof Windows PALETTEENTRY;
- Bits Two-Dimensional array of byte. the size of the array is specified in the bitmapInfoHeader.bSizeImage
Well this is what i am doing:
:confused:Code:
QVariantList list = ActiveXObject->Bitmap().toList(); uchar unChList[list.size()]; for (qint32 i = 0; i < list.size(); i++) { unChList[i] = a.at(i).toUInt(); } QPixmap pixBeam; pixBeam.loadFromData(unChList, list.size()); QPrinter printer; printer.setOutputFileName(name); printer.setFullPage(false); QPainter painter; if (!painter.begin(&printer)) { qWarning("failed to open file, is it writable?"); return; } painter.setWindow(0, 0, 1650, 2750); QPen pen; painter.setPen(pen); /********* *here i draw also some rects and text *********/ /********* *here i draw also some rects and text *********/ painter.end();
The text and and squares and lines are there but the bitmap is not.
How shall i conver this? i calling "fromData" function in a incorrect way?:crying:
Thanks for the help in Advance
PS: I have run with the printing of the value they have data inside.