GetImageLine
Top  Previous  Next

Description

This COM method returns the array of pixel values at the specified horizontal line of the image.


Syntax


[VB]
Value=objImageWarp.GetImageLine ( Inp, Line )


[C/C++]
HRESULT GetImageLine( int Inp, int Line, VARIANT* pArray );


Data Types
[VB]

Inp: Long
Line: Long
Return value: Variant (SAFEARRAY)


Parameters
[C/C++]

Inp [in]  
Index of the image  
Line [in]  
Zero-based number of image line (raw)  
pArray [out,retval]  
Pointer to the SAFEARRAY containing the pixel values in the image  


Return Values


S_OK  
Success  
E_FAIL  
Failure.  


Example


This VB code grabs an image, retrieves the 33th row of pixels and displays the value of 11th pixel in the row.


IW.Call("grabIm(1)")
While IW.Status <> SS_IDLE
Wend
LineArray=IW.GetImageLine (1, 32)
MsgBox LineArray(10)
IW.ReleaseImageArray (1)
 

Remarks


The type of data and size of the array returned by GetImageLine method depends on the format of the image, as specified in the following table:



Format
Data type
Size

8-bit monochrome
Byte
0 to SizeX -1
16-bit gray monochrome
Integer (word)
0 to SizeX -1
32-bit gray monochrome
Long (double word)
0 to SizeX -1
float
float (32-bit)
0 to SizeX -1
complex
float (32-bit)
0 to SizeX * 2 -1
24-bit RGB
Byte
0 to SizeX * 3 - 1
32-bit RGB
Byte
0 to SizeX * 4 - 1
48-bit RGB
Integer (word)
0 to SizeX * 3 - 1


Please note that the client application is responsible for freeing the memory occupied by the data array. In the example above Visual Basic does it automatically. If you write in C/C++, make sure to use the SafeArrayDestroy function from Win32 API after each call to GetImageLinePlease note that the client application is responsible for freeing the memory occupied by the data array. In the example above Visual Basic does it automatically. If you write in C/C++, make sure to use the SafeArrayDestroy function from Win32 API after each call to GetImageArray method.method.