Products & Services Solutions Academia Support User Community Company

Learn more about MATLAB Builder JA   

figToImStream - Stream out figure "snapshot" 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. int8 (signed byte) is used primarily for Java primitive byte type; Default value is int8.

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' );
  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS