Why do I receive an error when printing an image from a compiled MATLAB application?

2 views (last 30 days)
Why do I receive the error "ERROR: Failed to find MEX-File on path : iofun/private/wtifc.dll." when printing an image from a compiled MATLAB application?
I am unable to get my compiled MATLAB application to generate image files such as TIFF files. The MATLAB application works fine within MATLAB, but when I compile it, I receive the following error messages:
Failed to find MEX-File on path : iofun/private/wtifc.dll.
and
Function 'get_param' is not implemented in standalone mode.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
The main reason this error occurs is because you are attempting to use an unsupported feature of the PRINT function in standalone mode. The MATLAB C/C++ Graphics Library currently only supports a limited number of flags or options with the PRINT function and the "-dtiff" option is not one of them.
Currently, to work around this issue:
1.) Save the figure to a bitmap file using the PRINT function with the -dbitmap option
2.) Read from the file using the IMREAD function
3.) Use IMWRITE to create the TIFF image
The example code below shows this workaround:
tmpfname = 'outfile';
print('-dbitmap', [tmpfname, '.bmp']);
[X, map] = imread( [tmpfname, '.bmp'] );
delete( [tmpfname, '.bmp'] );
imwrite(X, map, [tmpfname, '.tif'], , 'tiff','resolution',300);

More Answers (0)

Categories

Find more on MATLAB Compiler in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!