SetImageLine
Top  Previous  Next

Description

This COM method maps the element of a linear array to pixel values at the specified horizontal line of the image.


Syntax


[VB]
objImageWarp.SetImageLine ( Inp, Line, Array )


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


Data Types
[VB]

Inp: Long
Line: Long
Array: 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  


Return Values


S_OK  
Success  
E_FAIL  
Failure.  


Example


This VB code grabs an image, retrieves the 33th row of pixels and copies it to row 45.


IW.Call("grabIm(1)")
While IW.Status <> SS_IDLE
Wend
LineArray=IW.GetImageLine (1, 32)
IW.SetImageLine(1, 45, LineArray)


Remarks


The type of data and size of the array that should be passed to SetImageLine 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