DrawLine2 Method

NI Vision for Visual Basic

DrawLine2 Method

Syntax

CWIMAQVision.DrawLine2 SourceImage, DestImage, Line, DrawMode [, GrayLevel = 0]

Return Type

Long

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

Purpose

Draws a line on an image.

Remarks

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

Parameters

SourceImage As CWIMAQImage

The input image.

DestImage As CWIMAQImage

The resulting image.

Line As CWIMAQLine

Defines the line to draw.

DrawMode As CWIMAQDrawModes

Defines how to draw the line. Valid values are cwimaqDrawModeFrame and cwimaqDrawModeInvFrame.

GrayLevel As Variant

[Optional] The pixel value that the method uses for drawing if you set DrawMode to cwimaqDrawModeFrame.

This parameter has a default value of 0.

Example

Dim i As New CWIMAQImage
Dim l As New CWIMAQLine

' Draw a line (10,20) - (50,100) on the image in Viewer1.
' Store the result in i.
l.Initialize 10, 20, 50, 100
CWIMAQVision1.DrawLine2 CWIMAQViewer1.Image, i, l, _
                        cwimaqDrawModeFrame, 255