当前位置: 代码迷 >> 综合 >> vc++ CImage读取影像文件,可以读取像素值
  详细解决方案

vc++ CImage读取影像文件,可以读取像素值

热度:21   发布时间:2024-02-12 14:28:51.0

CString sImageFilename = ;

ATL::CImage img;

HRESULT hr = img.Load(sImageFilename);

if(hr != S_OK)

{

      //错误

}

//获取影像宽高, 影像的坐标原点(0,0)是左上角点

int nw = img.GetWidth();
int nh = img.GetHeight();

COLORREF cr = img.GetPixel(col, row);

img.Detach();

  相关解决方案