MATLAB: Imwrite function in c++ shared library

c++ shared librarycompilerdllimwritelibrary

Greetings,
I am compiling a matlab code which has the imwrite function in it. I want it to create an image file and write it to the disk when the c++ code calls my dll. The problem is it does not output the image file. Is it not possible to use imwrite function in a c++ shared library? If it is so, are there any alternatives to this function that will create an image file in a predefined path the user provides?

Best Answer

imwrite() is not supported for code generation, for any file type.
(and imread() supports code generation only for reading 8 bit JPEG.)
You can find external libraries to write files, such as libjpeg and libtiff and libpng