0

I have an image buffer that I want to save to bmp file.

The code itself is C++ & app running on android using Qt.

Is there any basic function or open source library that I can use to save the buffer on the device ?

except FreeImage, I have some issues with this library in android.

cyberlobe
  • 1,783
  • 1
  • 18
  • 30
arii
  • 143
  • 2
  • 12

1 Answers1

0

Use QPixmap's save

QPixmap mypixmap;
mypixmap.save("filename", "BMP");

See http://doc.qt.io/qt-5/qpixmap.html#save

WLGfx
  • 1,169
  • 15
  • 31
  • but the saving code should be in the C++ scope, not the app itself. – arii Dec 22 '16 at 09:27
  • unless this lib supported c++ also? – arii Dec 22 '16 at 09:28
  • It's part of the Qt API framework. It supports the main formats, JPG, PNG, BMP and GIF... – WLGfx Dec 22 '16 at 09:32
  • so it's not help me sir.. I need c++ code that save the image – arii Dec 22 '16 at 09:34
  • You said you're using Qt, so the obvious choice was to use Qt's built in functionality. If you said you didn't want to use Qt's API, then I could've pointed to here http://stackoverflow.com/questions/2654480/writing-bmp-image-in-pure-c-c-without-other-libraries – WLGfx Dec 22 '16 at 09:37