This C++ example reserves an array of the full frame size, grabs a frame, retrieves a pointer to the frame and copies the content of the frame into array using the actual height of the image.
int iSizeX=m_ActiveGige.GetSizeX();
int iSizeY=m_ActiveGige.GetSizeY();
BYTE* pArray=new BYTE [iSizeX*iSizeY];
int iHeight=m_ActiveGige.GetHeight();
m_ActiveGige.Grab()
for (int i=0; i<iHeight; i++)
{
VARIANT v=m_ActiveGige.GetImagePointer(0,i); memcpy(pArray+iSizeX*i,v.pcVal,iWidth);
}
Remarks
This method allows you to determine the height of the image is a situation when it can be smaller than the Y size of the internal frame buffer defined by the SizeY property. This typically happens when a linescan camera used in the start-stop trigger mode transfers images of a variable height. Knowing the actual size of the image in the internal buffer allows you to process or display only a valid portion of the frame buffer and disregard an unused part.