ImageGear for C and C++ on Windows v19.5 - Updated
Method 3: Accessing Pixel Data Directly
User Guide > Concepts > Migrating from ImageGear v14 > Method 3: Accessing Pixel Data Directly

The function IG_image_DIB_raster_pntr_get provides a direct pointer to the pixel data for a raster as it is stored internally by ImageGear. The first raster, raster 0, is the top-most raster in the image. The easiest way to access pixel data directly is to loop over the rasters in the image and call IG_image_DIB_raster_pntr_get for each raster. However, since rasters are stored sequentially in memory, it is possible to retrieve a pointer to the first raster and use it to address the entire image. If you do this, you must be aware of the following details:

When accessing pixel data directly, the format of the data is the same as when the pixel access functions are used in "new" mode as described in the previous section. However, there is one exception: 1bpp images are always stored internally in a compressed format. If you need to access 1bpp images, you should use DIB import/export or pixel access functions instead of IG_image_DIB_raster_pntr_get. Alternatively, you can work with the compressed data directly as described in the Working with Run Ends Format section.