This function sets a horizontal raster line of pixels into the DIB image bitmap.
Declaration:
|
Copy Code
|
AT_ERRCOUNT ACCUAPI IG_DIB_raster_set (
HIGEAR hIGear,
AT_PIXPOS nYpos,
const LPAT_PIXEL lpPixel,
AT_MODE nFormat
);
|
Arguments:
Name |
Type |
Description |
hIGear |
HIGEAR |
HIGEAR handle of an image. |
nYpos |
AT_PIXPOS |
Raster line number (0 is top line). |
lpPixel |
const LPAT_PIXEL |
Far pointer to first byte of the pixel data to set. |
nFormat |
AT_MODE |
A variable of type AT_MODE which indicates in which manner the raster data should be stored: IG_PIXEL_PACKED, IG_PIXEL_UNPACKED, or IG_PIXEL_RLE. |
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:
See the example for function IG_DIB_raster_get().
Remarks:
nFormat should be set to the same format in which the rest of the data in the DIB is stored. If you choose IG_PIXEL_PACKED, your array of bytes should be padded with zeroes on the right, just as it is in the standard DIB format, such that its length is a multiple of 4.
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 image you are modifying is 1-bit, you must convert the image from run-end encoded to a standard DIB, before you can set pixel values. Please see the section Accessing Image Pixels for details.