【发布时间】:2014-10-21 01:02:34
【问题描述】:
我使用的是 VS2010 MFC。
我想做以下步骤。
- 加载位图文件(640x480, 8bit)。
- 设置坐标。 (x,y)
- 从坐标(0~255)获取像素值。
但我不知道步骤...
请告诉我:)
【问题讨论】:
-
想要在可见位图上执行此操作还是应该静默完成?
标签: bitmap mfc pixel coordinate
我使用的是 VS2010 MFC。
我想做以下步骤。
但我不知道步骤...
请告诉我:)
【问题讨论】:
标签: bitmap mfc pixel coordinate
这应该可行:
#include "atlimage.h" // This is neccesary to use CImage objects from GDI+
void dummy ()
{
std::string bitmapFile = "file.bmp"; // Full path of your bitmap file
int x = 0; // Your x coordinate
int y = 0; // Your y coordinate
CImage image;
if ( SUCCEEDED ( image.Load ( bitmapFile.c_str() ) ) )
{
COLORREF color = image.GetPixel ( x, y );
}
}
【讨论】: