qpixmap - Save byte array as .png/.jpg file in QT -


this have far:

qfile file(filename);   file.open(qiodevice::writeonly);   qpixmap pixmap = qpixmap.loadfromdata((const uchar *) imagebuffer_pointer, (sizeof(imagerows) * sizeof(imagecols));   pixmap.save(&file, "jpg");   pixmap.save(&file, "png");   

but produces 0 byte image files

it easier give save() function file name first parameter:

qpixmap pixmap = qpixmap.loadfromdata((const uchar *) imagebuffer_pointer,      (sizeof(imagerows) * sizeof(imagecols)); pixmap.save(filename, "jpg"); 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -