Click or drag to resize

IMcOperationsDiv Method

Divide 1 image by another, an image by a number, or a number by an image.

Namespace:  MediaCy.IQL.Operations
Assembly:  MediaCy.IQL.Operations (in MediaCy.IQL.Operations.dll) Version: 10.0.6912.0
Syntax
VB
Function Div ( 
	vOperand2 As Object,
	<OptionalAttribute> vOperand1 As Object
) As McImage

Parameters

vOperand2
Type: SystemObject
Second operand of the operation: McImage, or number (array for color images). vOperand2 resolves to a number, then zero values are illegal. If it resolves to a McImage, then where pixel values in the vOperand2 image are zero, the result will be the destination McImage.RangeMax.
vOperand1 (Optional)
Type: SystemObject
Optional first image operand (operator applies to parent image when parameter is omitted).

Return Value

Type: McImage
The resulting McImage.
Remarks
For new applications it is recommended that you use DivEx where the scaling offset and mcConversionMode can be passed as arguments. A conversion is performed on vOperand2 so that it has the same type as the source image. The conversion rules are defined by the value of the Conversion property. The result of the operation is multiplied by Offset to produce the final result: (Parent image [or vOperand1] * Offset) / vOperand2 which is stored in the parent image or vOperand1 if there is no parent. Note that the Offset property should usually be assigned a value before calling this method, because it is zero by default. However, any Offset of zero is ignored (it is treated as 1). For floating point image types, the stored results may exceed the bounds of the current destination McImage.RangeMin to McImage.RangeMax. These range properties are not changed automatically.
Examples
VB
Sub TestDiv()
Dim img8bitGray As McImage
Set img8bitGray = ThisApplication.Images.Open(Path + "Images\GrayBlk.tif")
ThisApplication.ActiveImage.ConvertEx mciqtGray16, mcicfScale
' ThisApplication.ActiveImage is now the 16-bit version of GrayBlk
ThisApplication.ActiveImage.Op.ResetProperties 'sets Conversion = mccmScale
ThisApplication.ActiveImage.Op.Offset = 65535 'multiplicative Offset
ThisApplication.ActiveImage.Op.Div img8bitGray
' resulting image is all white
End Sub 'TestDiv
See Also