FillImage2 Method

NI Vision for Visual Basic

FillImage2 Method

Syntax

CWIMAQVision.FillImage2 DestImage [, PixelOrReal = 0] [, Imaginary = 0] [, RGBU64] [, MaskImage]

Return Type

Long

On success, this method returns 0. On failure, this method returns a negative number.

Purpose

Sets each pixel in an image to a specified value.

Parameters

DestImage As CWIMAQImage

The image whose pixel values the method overwrites with the given value.

PixelOrReal As Variant

[Optional] The value the method uses to fill the image pixels. If the image is Complex, the method fills the real part of the pixels with this value.

This parameter has a default value of 0.

Imaginary As Variant

[Optional] If the image is Complex, the method fills the imaginary part of the pixels with this value. The method ignores this parameter otherwise.

This parameter has a default value of 0.

RGBU64 As Variant

[Optional] A 1D array with 4 integer elements (the red, green, blue, and alpha planes) used to fill RGBU64 images.

MaskImage As Variant

[Optional] The method processes only those pixels in the image whose corresponding pixels in the mask are non-zero. Do not set this parameter if you want to fill the entire image with pixel values.

Example

Dim maskImage As New CWIMAQImage

' Fill the portion of the image in Viewer1 based on the regions
' selected on Viewer1.
CWIMAQVision1.RegionsToMask maskImage, CWIMAQViewer1.Regions
CWIMAQVision1.FillImage2 CWIMAQViewer1.Image, 255, , maskImage

See Also

RegionsToMask