|
조현 님이 쓰신 글 :
: 비트맵 파일인데 헤더를 빼고 Raw 데이터만 넘어오는 상태입니다.
: 이것을 헤더를 붙여서 비트맵으로 취급하려고 하는데, 비트맵 파일 형식을 모르겠군요.
: 아시는 님 지도 부탁드립니다.
: 참고할 수 있는 자료를 주심 더 좋구요...
: 부탁드려여...
: 이만...
// 아래의 내용이 도움 될까요..
// 헤더에
LPBITMAPINFO m_lpBitmapInfo;
Byte *pImgBuff,
HBITMAP m_hBitmap;
//----- Bitmap Info 설정.
m_lpBitmapInfo = (BITMAPINFO *)GlobalAlloc(
GMEM_FIXED, sizeof(BITMAPINFOHEADER) + 256*sizeof(RGBQUAD));
if(m_lpBitmapInfo == NULL) return false;
m_lpBitmapInfo->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
m_lpBitmapInfo->bmiHeader.biWidth = ImgW;
m_lpBitmapInfo->bmiHeader.biHeight = ImgH;
m_lpBitmapInfo->bmiHeader.biPlanes = 1;
m_lpBitmapInfo->bmiHeader.biBitCount = 8;
m_lpBitmapInfo->bmiHeader.biCompression = BI_RGB;
m_lpBitmapInfo->bmiHeader.biSizeImage = ImgW*ImgH;
m_lpBitmapInfo->bmiHeader.biXPelsPerMeter = 0;
m_lpBitmapInfo->bmiHeader.biYPelsPerMeter = 0;
m_lpBitmapInfo->bmiHeader.biClrUsed = 0;
m_lpBitmapInfo->bmiHeader.biClrImportant = 0;
for(short j=0; j<256; j++) {
m_lpBitmapInfo->bmiColors[j].rgbBlue = j;
m_lpBitmapInfo->bmiColors[j].rgbRed = j;
m_lpBitmapInfo->bmiColors[j].rgbGreen = j;
}
m_hBitmap = CreateDIBSection(
NULL, m_lpBitmapInfo, DIB_RGB_COLORS, (void **)&pImgBuff, NULL, 0);
|