★初心者にVisual C++を教えるスレ★ Part14
■ このスレッドは過去ログ倉庫に格納されています
0623>>619
NGNGASSERT(pInfoHeader->biBitCount == 24);
int x, y;
LPBYTE p = pPixcel;
for(y = 0 ; y < BmpHeight ; y++)
{
for(x = 0 ; x < BmpWidth ; x++)
{
if(p[0] == 0 && p[1] == 0 && p[2] == 0)
{
p[0] = 0xFF;p[1] = 0xFF;p[2] = 0xFF;
}
else if(p[0] == 0xFF && p[1] == 0xFF && p[2] == 0xFF)
{
p[0] = 0;p[1] = 0;p[2] = 0;
}
p += 3;
}
}
HWND hWnd = GetSafeHwnd();
HDC hDC = ::GetDC(hWnd);
int lines = ::StretchDIBits(hDC, 0, 0, BmpWidth, BmpHeight, 0, 0, BmpWidth, BmpHeight, pPixcel, (LPBITMAPINFO)pInfoHeader, DIB_RGB_COLORS, SRCCOPY);
ASSERT(lines == BmpHeight);
::ReleaseDC(hWnd, hDC);
delete [] lpBMP;
}
でどうかな?
■ このスレッドは過去ログ倉庫に格納されています