SetImageArray
Top  Previous  Next

Description

This COM method maps the elements of the two dimensional array to pixel values in the specified image.


Syntax


[VB]
objImageWarp.SetImageArray ( Inp, Array )


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


Data Types
[VB]

Inp: Long
Array
: Variant (SAFEARRAY)


Parameters
[C/C++]

Inp [in]  
Index of the image  
pArray [out,retval]  
Pointer to the SAFEARRAY containing the pixel values in the frame  


Return Values


S_OK  
Success  
E_FAIL  
Failure.  


Example


This VB code grabs an image, retrieves its content and copies it to another image.

IW.Call("grabIm(1)")
While IW.Status <> SS_IDLE
Wend
DataArray=IW.GetImageArray (1)
IW.SetImageArray(2, DataArray)
 

Remarks


The type of data and dimensions of the array that should be passed to GetImageArray method depends on the format of the image, as specified in the following table:



Format
Data type
Dimensions

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