QImage real bytes count
-
how should this be possible since it depends in which format you save the file on the disk?
-
it's still not possible directly from QImage ;)
You would first save it to this format and check it's resulting data size. This may block your application depending on the size of the image. If so you may want to do this in another thread.
@
QImage image;
QByteArray ba;
QBuffer buffer(&ba);
buffer.open(QIODevice::WriteOnly);
image.save(&buffer, "PNG");
buffer.close();int fileSize = ba.size();
@ -
It is still a synchronous job.
[quote author="raven-worx" date="1379919631"]it's still not possible directly from QImage ;)You would first save it to this format and check it's resulting data size. This may block your application depending on the size of the image. If so you may want to do this in another thread.
@
QImage image;
QByteArray ba;
QBuffer buffer(&ba);
buffer.open(QIODevice::WriteOnly);
image.save(&buffer, "PNG");
buffer.close();int fileSize = ba.size();
@[/quote] -
[quote author="silex92" date="1379920609"]It is still a synchronous job.
[/quote]
Yes as i said!
If you do want it to do asynchronously use another thread using signals and slots with a queued connection.