Skip to Main Content Skip to Search
Product Documentation

figToImStream - Stream out figure as byte array encoded in format specified, creating signed byte array in .png format

Syntax

output type = figToImStream ('fighandle', figure_handle, 'imageFormat', image_format, 'outputType', output_type)

Description

The output type = figToImStream ('fighandle', figure_handle, 'imageFormat', image_format, 'outputType', output_type) command also accepts user-defined variables for any of the input arguments, passed as a comma-separated list

The size and position of the printed output depends on the figure's PaperPosition[mode] properties.

Options

figToImStream('figHandle', Figure_Handle, ...) allows you to specify the figure output to be used. The Default is the current image

figToImStream('imageFormat', [png|jpg|bmp|gif]) allows you to specify the converted image format. Default value is png.

figToImStream('outputType', [int8!uint8]) allows you to specify an output byte data type. uint8 (unsigned byte) is used primarily for .NET primitive byte. Default value is uint8.

Examples

Convert the current figure to a signed png byte array:

      surf(peaks)
      bytes = figToImStream

Convert a specific figure to an unsigned bmp byte array:

        f = figure;
        surf(peaks);
        bytes = figToImStream(  'figHandle', f, ...
                                'imageFormat', 'bmp', ...
                                'outputType', 'uint8' );
  


Free MATLAB Compiler Interactive Kit

Learn how to build standalone executables and C/C++ shared libraries from MATLAB code.


Get free kit

Trials Available

Try the latest version of MATLAB Compiler.


Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS