共用方式為


CImage::GetPixelAddress

Retrieves the exact address of a pixel.

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

Parameters

  • x
    The x-coordinate of the pixel.

  • y
    The y-coordinate of the pixel.

Remarks

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.

注意

This method supports only DIB section bitmaps.

Requirements

Header: atlimage.h

See Also

Concepts

CImage Class

CImage Members