I am trying to create a QByteArray from QImage, however, although I tried many variations, I could not handle it.
What am I doing:
QImage img_enrll;
QByteArray arr((char*)img_enrll.bits(),img_enrll.byteCount());
funcCheck((unsigned char*)arr.data(), arr.size(), 0, &sam, 1, &n);
virtual Error funcCheck (const uint8_t src[],
size_t src_len,
size_t tout_ms,
IRawSample* dst[],
size_t dst_len,
size_t* dst_n )
However, the error code is invalid data. I think the conversion of QImage to QByteArray is wrong. Please, could you help me how to convert to QByteArray?
source
share