SetImagePixel
Top  Previous  Next

Description

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


Syntax


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


[C/C++]
HRESULT SetImagePixel( int Inp, int X, int Y, float Value );


Data Types
[VB]

Inp: Long
X: Long
Y: Long
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  
Value [in]  
The pixel value  


Return Values


S_OK  
Success  
E_FAIL  
Failure.  


Example


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


IW.Call("grabIm(1)")
While IW.Status <> SS_IDLE
Wend
IW.SetImagePixel (1, 64, 32, 255)

 

Remarks


Depending on the type of the image, the pixel 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
Complex image
the active component of the pixel