| MFC Library Reference |
See Also
CDC Overview | Class Members | Hierarchy Chart | CDC::GetDeviceCaps | CDC::SetPixel | tabindex="0" keywords="_WIN32_GetPixel">GetPixel | POINT | CPoint
Retrieves the RGB color value of the pixel at the point specified by x and y.
COLORREF GetPixel( int x, int y ) const; COLORREF GetPixel( POINT point ) const;
Parameters
-
x
- Specifies the logical x-coordinate of the point to be examined. y
- Specifies the logical y-coordinate of the point to be examined. point
- Specifies the logical x- and y-coordinates of the point to be examined.
Return Value
For either version of the function, an RGB color value for the color of the given point. It is –1 if the coordinates do not specify a point in the clipping region.
Remarks
The point must be in the clipping region. If the point is not in the clipping region, the function has no effect and returns –1.
Not all devices support the GetPixel function. For more information, see the RC_BITBLT raster capability under the GetDeviceCaps member function.
博客介绍了CDC::GetPixel函数,该函数可获取指定点的RGB颜色值。介绍了其相关参考内容、参数、返回值,若坐标不在裁剪区域返回 -1,且并非所有设备都支持该函数,更多信息可查看GetDeviceCaps成员函数下的RC_BITBLT光栅功能。
3224

被折叠的 条评论
为什么被折叠?



