pDoc = GetDocument();
int iBitPerPixel = pDoc->_bmp->bitsperpixel; // used to see if grayscale(8 bits) or RGB (24 bits)
int iWidth = pDoc->_bmp->width;
int iHeight = pDoc->_bmp->height;
BYTE *pImg = pDoc->_bmp->point; // pointer used to point at pixels in the image
int Wp = iWidth;
const int area = iWidth * iHeight;
int r; // red pixel value
int g; // green pixel value
int b; // blue pixel value
int gray; // gray pixel value
BYTE *pImgGS = pImg; // grayscale image pixel array
и попытаемся изменить изображение RGB на серое, вот так:
// convert RGB values to grayscale at each pixel, then put in grayscale array
for (int i = 0; i
Подробнее здесь: [url]https://stackoverflow.com/questions/45604567/cvisual-studio-change-rgb-to-grayscale[/url]
int iBitPerPixel = pDoc->_bmp->bitsperpixel; // used to see if grayscale(8 bits) or RGB (24 bits) int iWidth = pDoc->_bmp->width; int iHeight = pDoc->_bmp->height; BYTE *pImg = pDoc->_bmp->point; // pointer used to point at pixels in the image int Wp = iWidth; const int area = iWidth * iHeight; int r; // red pixel value int g; // green pixel value int b; // blue pixel value int gray; // gray pixel value