Table Of Contents

Flatten Image to Byte Array (G Dataflow)

Last Modified: March 26, 2019

Returns the string representation of an image using the provided options.

connector_pane_image
datatype_icon

image in

Reference to the source image.

datatype_icon

compression type in

Method of compression to use when flattening the image to a byte array.

The following values are valid:

Name Value Description
None 0

Performs no image compression on the image.

JPEG 1

Performs lossy JPEG image compression on the image. JPEG compression may cause data degradation in the flattened image.

PACKED BINARY 2

Performs lossless binary packing on the image. This setting is ideal for preserving data integrity when you are compressing binary images. Do not use this setting for nonbinary images.

datatype_icon

quality

Image quality stored in the string.

quality is a measure of the compression method, such that a lower compression factor results in higher image quality. The allowable range for quality is 0 to 1000. As you lower the quality value, you increase the amount of loss that occurs during compression. The quality parameter is only used when you select JPEG compression.

Default: 750

datatype_icon

flatten type in

Type of data to store in the byte array.

The following values are valid:

Name Value Description
Image 0

Stores the image pixel data and overlay information in the string.

Image and Vision Info 1

(Default) Stores the image pixel data and Vision Extra Information, such as calibration, overlay, template, and custom data information, in the image string.

Reference to Image 2

Stores only a reference to the image in the string. Unflattening the string will return another reference to the same image. You will not be able to unflatten the string if the original image has been disposed.

datatype_icon

error in

Error conditions that occur before this node runs.

The node responds to this input according to standard error behavior.

Standard Error Behavior

Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

error in does not contain an error error in contains an error
If no error occurred before the node runs, the node begins execution normally.

If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

Default: No error

datatype_icon

image out

Reference to the source image.

datatype_icon

flatten image byte array

LabVIEW string containing the string representation of the image.

Use the Unflatten from String LabVIEW primitive to convert this string back to an image. If an image has the same name as the flattened image in memory, when the string is unflattened, the contents of the flattened image string are copied to the image. Otherwise, a new image with a unique name is created that contains the contents of the flattened image string.

datatype_icon

error out

Error information.

The node produces this output according to standard error behavior.

Standard Error Behavior

Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

error in does not contain an error error in contains an error
If no error occurred before the node runs, the node begins execution normally.

If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

Where This Node Can Run:

Desktop OS: Windows

FPGA: Not supported

Web Server: Not supported in VIs that run in a web application


Recently Viewed Topics