FindPolygonArea Method

NI Vision for Visual Basic

FindPolygonArea Method

Syntax

CWIMAQVision.FindPolygonArea Vertices, Area

Return Type

Long

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

Purpose

Computes the area of a polygon described by the coordinates of its vertices.

Remarks

The polygon must contain three or more vertices.

Parameters

Vertices As CWIMAQPoints

Defines the vertices of the polygon. This collection must have three or more items corresponding to three or more points located at the vertices of the polygon.

Area As Single

On return, the area of the polygon.

Example

Dim points As New CWIMAQPoints
Dim points As New CWIMAQPoints
Dim area As Single

' Find the area of a triangle defined by the points
' (0,0), (0,30) and (30, 0)
points.Initialize Array(0, 0, 30), Array(0, 30, 0)
CWIMAQVision1.FindPolygonArea points, area