IMcImageGetPixel Method
|
|
Get a pixel value.
Namespace:
MediaCy.IQL.Engine
Assembly:
MediaCy.IQL.Engine (in MediaCy.IQL.Engine.dll) Version: 10.0.6912.0
SyntaxFunction GetPixel (
<OutAttribute> ByRef pvPixel As Object,
x As Integer,
y As Integer,
Optional Frame As Integer = -2
) As Integer
Parameters
- pvPixel
- Type: SystemObject
A pointer to a VARIANT receiving the pixel value.
If the VARIANT is empty, the function will return one of a type
compatible with the image type. - x
- Type: SystemInt32
The x-location of the pixel. 0 indicates a pixel along the
edge of the image. - y
- Type: SystemInt32
The y-location of the pixel. 0 indicates a pixel along the
first line of the image. - Frame (Optional)
- Type: SystemInt32
Return Value
Type:
Int32One value returned per channel (1 for gray
scale images, 3 for color images).
RemarksSee CreateRegionAccess for a more controlled way to get pixel values.
When the routine itself creates the variant it is typed after the image type,
which guarantees that the pixel values will fit into it. If pvPixel is already
typed, it must be of the right data type and size.
For languages that do not support the unsigned integer type (like Visual Basic or VBA),
16 bits values bigger than 32767 will be reported as negative because their sign bit is set.
The best way to work around this limitation is to create a "long" McRegionAccess using
McImage.CreateRegionAccess and call its own version of GetPixel, which will then
return long positive values (4 bytes) instead of unsigned integers (2 bytes).
See Also