Modulo Method
Syntax
CWIMAQVision.Modulo SourceImage, Operand, DestImage
Return Type
On success, this method returns 0. On failure, this method returns a negative number.
Purpose
Takes the modulo of an image by an image or an image by a constant.
Remarks
Use this method with U8, I16, SGL, and RGB32 images.
SourceImage and DestImage must be the same type of image. If Operand is an image, its type depends on the type of SourceImage, as follows:
- If SourceImage is U8, Operand must be U8.
- If SourceImage is I16, Operand must be I16 or U8.
- If SourceImage is SGL, Operand must be SGL, I16, or U8.
- If SourceImage is RGB32, Operand must be RGB32 or U8.
Parameters
SourceImage As CWIMAQImage
The first input image.
Operand As Variant
The second input image or a constant. Constants are rounded down if SourceImage is encoded as an integer.
DestImage As CWIMAQImage
The resulting image. It can be one of the source images.
Example
Dim i As New CWIMAQImage ' Modulo divide the image in Viewer1 by a constant ' Store the result in i CWIMAQVision1.Modulo CWIMAQViewer1.Image, 50, i ' Modulo divide the image in Viewer1 by the image in i ' Do the division in-place (store the result in i) CWIMAQVision1.Modulo CWIMAQViewer1.Image, i, i