CBitmap img; CDC dc; BITMAP bmp; img.LoadBitmapW(IDB_BITMAP1); img.GetBitmap(&bmp); CDC* pDC = this->GetDC(); dc.CreateCompatibleDC(pDC); CBitmap* pOld = dc.SelectObject(&img); for(int y = 0; y < bmp.bmHeight; y++) { for(int x = 0; x < bmp.bmWidth; x++) { COLORREF rgb = dc.GetPixel(x, y); BYTE r = GetRValue(rgb); BYTE g = GetGValue(rgb); BYTE b = GetBValue(rgb); dc.SetPixel(x, y, RGB(r,g,b)); } } pDC->BitBlt(200, 200, bmp.bmWidth, bmp.bmHeight, &dc, 0, 0, SRCCOPY); dc.SelectObject(pOld);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)