在vc++中怎么获取象素点的颜色值,怎么给像素点加色?

shamfox 2005-12-06 05:04:51
在vc++中怎么获取象素点的颜色值,怎么给像素点加色?
getpixel和putpixel在vc++中可以用吗?
...全文
199 2 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
ypine 2005-12-06
  • 打赏
  • 举报
回复
关注中ing
j805 2005-12-06
  • 打赏
  • 举报
回复
Windows GDI
GetPixel
The GetPixel function retrieves the red, green, blue (RGB) color value of the pixel at the specified coordinates.

COLORREF GetPixel(
HDC hdc, // handle to DC
int nXPos, // x-coordinate of pixel
int nYPos // y-coordinate of pixel
);
Parameters
hdc
[in] Handle to the device context.
nXPos
[in] Specifies the x-coordinate, in logical units, of the pixel to be examined.
nYPos
[in] Specifies the y-coordinate, in logical units, of the pixel to be examined.
Return Values
The return value is the RGB value of the pixel. If the pixel is outside of the current clipping region, the return value is CLR_INVALID.

Remarks
The pixel must be within the boundaries of the current clipping region.

Not all devices support GetPixel. An application should call GetDeviceCaps to determine whether a specified device supports this function.

Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Wingdi.h; include Windows.h.
Library: Use Gdi32.lib.


可以的.

19,472

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 图形处理/算法
社区管理员
  • 图形处理/算法社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧