GetImagePixel
Top  Previous  Next

Description

This COM method returns the pixel value at the specified coordinates of the image.


Syntax


[VB]
Value=objImageWarp.GetImagePixel ( Inp, X, Y )


[C/C++]
HRESULT GetImagePixel( int Inp, int X, int Y, float *pValue );


Data Types
[VB]

Inp: Long
X: Long
Y: Long
Return value: Float


Parameters
[C/C++]

Inp [in]  
Index of the image  
X [in]  
The x-coordinate of the pixel  
Y [in]  
The y-coordinate of the pixel  
pValue [out,retval]  
Pointer to the pixel's value  


Return Values


S_OK  
Success  
E_FAIL  
Failure.  


Example


This VB code grabs an image and displays the value of the pixel at the specified coordinates


IW.Call("grabIm(1)")
While IW.Status <> SS_IDLE
Wend
value=IW.GetImagePixel (1, 64, 32)
MsgBox value
 

Remarks


Depending on the type of the image, the return value must be interpreted differently:
 
Grayscale (8, 16, 32 bpp) or floating image
the intensity of the pixel
Palettized or multiphase image
the index in the image palette
RGB (16, 24, 32, 48 bpp) image
(R+G+B) / 3
Complex image
the active component of the pixel