ImageGear for C and C++ on Windows v20.5 - Updated
IG_DIB_column_get
API Reference Guide > Core Component API Reference > Core Component Functions Reference > DIB Functions > IG_DIB_column_get

This function obtains a column of pixels from the DIB image bitmap of image hIGear, and stores the pixels in your data area pointed to by lpPixel.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_DIB_column_get ( 
        HIGEAR hIGear, 
        AT_PIXPOS nX, 
        AT_PIXPOS nY1, 
        AT_PIXPOS nY2, 
        LPAT_PIXEL lpPixel, 
        AT_DIMENSION nLenBytes, 
        LPAT_DIMENSION lpNumPixels
);

Arguments:

Name Type Description
hIGear HIGEAR HIGEAR handle of image.
nX AT_PIXPOS X offset (X coord) of the vertical pixel column to get.
nY1 AT_PIXPOS Raster line number at which the vertical column starts.
nY2 AT_PIXPOS Raster line number at which the vertical column ends.
lpPixel LPAT_PIXEL Far pointer to your data area to which the pixels should be returned.
nLenBytes AT_DIMENSION Size of the data area, in bytes.
lpNumPixels LPAT_DIMENSION Far pointer to a AT_DIMENSION variable in which will be returned the number of pixels (not bytes) transferred.

Return Value:

Returns the number of ImageGear errors that occurred during this function call. If there are no errors, the return value is IGE_SUCCESS.

Supported Raster Image Formats:

All pixel formats supported by ImageGear for C and C++.

Sample:

Pixel Access

Example:

 
Copy Code
HIGEAR hIGear;           /* HIGEAR handle of image                                       */
AT_PIXEL cPixArray[400];  /* Receives the returned pixels       */
AT_PIXPOS nCol, nYtop, nYbot; /* Column and which rows to get           */
AT_DIMENSION nFetched;  /* Holds count of pixels retrieved      */
AT_ERRCOUNT nErrcount;  /* Receives returned error counts       */
nCol  = 0;   /* Fetch left boundary of image    */
nYtop = 10;  nYbot = 59;   /* 50 pixels, from lines 10 thru 59          */
nErrcount = IG_DIB_column_get ( hIGear, nCol, nYtop, nYbot, &cPixArray[0], 400, &nFetched
);

Remarks:

The offset of the column to retrieve is indicated by nX. The beginning and ending raster lines of the column are nY1 and nY2, respectively (top to bottom).

ImageGear's pixel access functions consider the coordinates (0,0) to refer to the upper left-hand corner of the bitmap data. They do not follow the DIB's orientation, which considers (0,0) to refer to the lower left-hand corner of the bitmap.

If the pixels will not fit in nLenBytes, only nLenBytes of data will be transferred. The actual number of pixels transferred is returned in the variable pointed to by lpNumPixels.

If the image is 1-bit or 4-bit, the pixels will be returned one to a byte, right justified in the byte. If the image is 24-bit, each pixel will occupy 3 bytes, in Blue-Green-Red order.

Is this page helpful?
Yes No
Thanks for your feedback.