FillImage Method

NI Vision for Visual Basic

FillImage Method

Syntax

CWIMAQVision.FillImage DestImage, PixelOrReal [, Imaginary = 0] [, MaskImage]

Return Type

Long

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

Purpose

Obsolete—Use FillImage2 instead. Sets each pixel in an image to a specified value.

Remarks

Use this method with all image types except RGBU64.

Parameters

DestImage As CWIMAQImage

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

PixelOrReal As Single

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.

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.

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.FillImage CWIMAQViewer1.Image, 255, , maskImage

See Also

FillImage2

RegionsToMask