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

This function obtains an arbitrary line of pixels from the DIB image bitmap of the image referenced by hIGear.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_DIB_line_get ( 
        HIGEAR hIGear, 
        AT_PIXPOS nX1, 
        AT_PIXPOS nY1, 
        AT_PIXPOS nX2, 
        AT_PIXPOS nY2, 
        LPAT_PIXEL lpPixel, 
        const AT_DIMENSION nlenOfArray, 
        LPAT_DIMENSION lpNumPixels 
);

Arguments:

Name Type Description
hIGear HIGEAR HIGEAR handle of image.
nX1 AT_PIXPOS X coordinate of the first endpoint of line to get.
nY1 AT_PIXPOS Y coordinate of the first endpoint.
nX2 AT_PIXPOS X coordinate of the second endpoint of line.
nY2 AT_PIXPOS Y coordinate of the second endpoint.
lpPixel LPAT_PIXEL Far pointer to your data area to which the pixels should be returned.
nLenOfArray const AT_DIMENSION Length, in bytes, of lpPixel block.
lpNumPixels LPAT_DIMENSION Far pointer to an AT_DIMENSION variable in which the number of pixels (not bytes) transferred is returned.

Return Value:

Returns the number of ImageGear errors that occurred during the 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:

See the example for function IG_DIB_line_set().

Remarks:

The line of pixels does not have to be horizontal or vertical. nX1,nY1 are the coordinates of one endpoint of the line and nX2,nY2 are of the other.

If the pixel data would overflow your area (nLenOfArray), the transfer will be truncated; your data area will not be overflowed. The actual number of pixels returned will be stored in your variable pointed to by lpNumPixels.

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.

To determine the number of pixels that your line will be comprised of, use the following formula:
max((1+abs(x2-x1)), (1+abs(y2-y1)))

1-bit and 4-bit pixels are returned one to a byte, right justified. 24-bit pixels are returned 3 bytes per pixel, in Blue-Green-Red order.

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