Converting QImage to QByteArray using QDataStream
问题 Im trying to convert a QImage that maked from ScreenShot to a QByteArray for sending via QTCPSocket. when i convert QImage to QByteArray and before sending it i try to deserialize and show it on label it cant ! what's my mistake? thx for helping. QByteArray ImClientShooter::toQByteArray(QImage &img) { QByteArray temp; QDataStream data(&temp, QIODevice::ReadWrite); data « img; return temp; } QByteArray goOn{toQByteArray(sampleQImage)}; //sampleQImage is a QImage Object lbl->setPixmap(QPixmap: