SetImageWindow
Top  Previous  Next

Description

Copies pixel values from the two-dimensional array into the selected window of the current frame.


Syntax


[VB]
objActiveGeni.SetImageWindow X, Y, A


[C/C++]
HRESULT SetImageWindow( short X, short Y, VARIANT* pArray );


Data Types
[VB]

X,Y: Integer
A
: Variant (SAFEARRAY)


Parameters
[C/C++]
 
X [in], Y[in]  
The x- and y- frame coordinates at which the top left corner of the window will be copied.  
pArray [out,retval]  
Pointer to the SAFEARRAY containing the pixel values to be copied.  


Return Values


S_OK  
Success  
E_FAIL  
Failure  
E_INVALIDARG  
Input array has wrong data type  


Example


This VB example uses the FrameAcquired event to increase the brightness in the central area of the live image:

Private Sub
 Form_Load()

ActiveGeni1.Display = 
False

ActiveGeni1.Acquire = 
True

End Sub

 
Private Sub
 ActiveGeni1_FrameAcquired()

xc = ActiveGeni1.SizeX / 2
yc = ActiveGeni1.SizeY / 2
w = ActiveGeni1.GetImageWindow(xc - 70, yc - 50, 140, 100)

For
 y = 0 To UBound(w, 2)
For
 x = 0 To UBound(w, 1)
pix = w(x, y) + 50

If
 pix > 255 Then
pix = 255

End If

w(x, y) = pix

Next
Next

ActiveGeni1.SetImageWindow xc - 70, yc - 50, w
ActiveGeni1.Draw

End Sub

 

Remarks


The array submitted to SetImageWindow must have the type and dimensions corresponding of those of the frame buffer, as specified in the following table:

Camera Pixel Format
Output Format
Data type
Horizontal Dimension

Mono8
8-bit monochrome
Byte
Width
Mono10, Mono12, Mono16
16-bit gray monochrome
Integer (word)
Width
YUV411, YUV422, YUV444, RGB8, BGR8
24-bit RGB
Byte
Width*3
RGB10, RGB12, RGB16, BGR10, BGR12
48-bit RGB
Integer (word)
Width*3


where Width is the intended horizontal size of the window in pixels. If the dimensions of the window are too large to accommodate the frame size, they will be clipped to the frame boundaries.

For real-time image processing SetImageWindow should be used in conjunction with the Draw method.