SetLine2 Method

NI Vision for Visual Basic

SetLine2 Method

Syntax

CWIMAQVision.SetLine2 DestImage, Line, Array

Return Type

Long

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

Purpose

Changes the intensity values in a line of pixels of an image.

Remarks

Use this method with U8, U16, I16, SGL, RGB32, HSL32, and RGBU64 images.

Parameters

DestImage As CWIMAQImage

The image whose line pixels are modified.

Line As CWIMAQLine

Specifies the coordinates of the line to change. Any pixels designated by the Line found outside the actual image are not replaced.

Array As Variant

The one-dimensional array of pixel values that the method uses to replace the values in the line.

Example

Private Sub Run_Click()
    Dim line As New CWIMAQLine
    Dim pixelArray
    
    ' Initialize the line
    line.Initialize 10, 10, 200, 200
    
    ' Get the pixels from the image in Viewer1
    CWIMAQVision1.GetLine2 CWIMAQViewer1.Image, line, pixelArray
    
    ' Set this line of pixels at a different
    ' location into the same image.
    line.Initialize 10, 200, 200, 10
    CWIMAQVision1.SetLine2 CWIMAQViewer1.Image, line, pixelArray
End Sub

See Also

GetLine2