CDC::GetPixel COLORREF GetPixel( int x, int y ) const;COLORREF GetPixel( POINT point ) const;Return ValueFor 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. GetRValue This macro retrieves an intensity value for the red component of a 32-bit red, green, blue (RGB) value. BYTE GetRValue( DWORD rgb ); GetGValue This macro retrieves an intensity value for the green component of a 32-bit red, green, blue (RGB) value. BYTE GetGValue( DWORD rgb ); GetBValue This macro retrieves an intensity value for the blue component of a 32-bit red, green, blue (RGB) value. BYTE GetBValue( DWORD rgb ); 用这几个函数就可以吧
COLORREF GetPixel( int x, int y ) const;COLORREF GetPixel( POINT point ) const;Return ValueFor 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.
GetRValue
This macro retrieves an intensity value for the red component of a 32-bit red, green, blue (RGB) value. BYTE GetRValue(
DWORD rgb );
GetGValue
This macro retrieves an intensity value for the green component of a 32-bit red, green, blue (RGB) value. BYTE GetGValue(
DWORD rgb );
GetBValue
This macro retrieves an intensity value for the blue component of a 32-bit red, green, blue (RGB) value. BYTE GetBValue(
DWORD rgb );
用这几个函数就可以吧
先用LoadImage()得到这幅图片,再从像素位的指针处开始读内存中的值,但一定要注意BMP影像格式的要求,即一条线Size等于4的倍数。其他具体的做法可以参考<<Windows 程序设计>>第十五章--与设备无关的位图。
其他格式的图片我也不会。