CImage::GetPixelAddress

Retrieves the exact address of a pixel.

void* GetPixelAddress(
   int x,
   int y 
) throw( );

x

The x-coordinate of the pixel.

y

The y-coordinate of the pixel.

The address is determined according to the coordinates of a pixel, the pitch of the bitmap, and the bits per pixel.

For formats that have less than 8 bits per pixel, this method returns the address of the byte containing the pixel. For example, if your image format has 4 bits per pixel, GetPixelAddress returns the address of the first pixel in the byte, and you must calculate for 2 pixels per byte.

NoteNote

This method supports only DIB section bitmaps.

Header: atlimage.h

Reference

Other Resources

Community Additions

ADD
Show: