본문 바로가기
코스웨어/15년 스마트컨트롤러

printbmp함수

by 알 수 없는 사용자 2015. 11. 23.
728x90
반응형

void PrintBmpInfo(BITMAPFILEHEADER *stpFH, BITMAPINFOHEADER *stpIH)
{
  UINT uiYCnt;

  WCHAR *ucTitle[] = {
    L"Magic Number:", 
    L"
파일크기:",
    L"
데이터 오프셋:",
    L"
Info 헤더사이즈:",
    L"
가로:",
    L"
세로:",
    L"
비트 플레인:",
    L"
픽셀당 비트:",
    L"
압축 유형:",
    L"
데이터 크기:",
    L"
수평 해상도:",
    L"
수직 해상도:",
    L"
사용 칼라인덱스 수:",
    L"
중요 칼라인덱스 수:"
  };

  WCHAR ucValue[14][30];

  wsprintf(ucValue[0], L"
[%c][%c]", *(((unsigned char *)(stpFH)) + 0), *(((unsigned char *)(stpFH)) + 1));
  wsprintf(ucValue[1], L"
%d Bytes", stpFH->bfSize);
  wsprintf(ucValue[2], L"%d", stpFH->bfOffBits);
  wsprintf(ucValue[3], L"%d", stpIH->biSize);
  wsprintf(ucValue[4], L"%d pixel", stpIH->biWidth);
  wsprintf(ucValue[5], L"%d pixel", stpIH->biHeight);
  wsprintf(ucValue[6], L"%d", stpIH->biPlanes);
  wsprintf(ucValue[7], L"%d", stpIH->biBitCount);
  wsprintf(ucValue[8], L"%d", stpIH->biCompression);
  wsprintf(ucValue[9], L"%d Bytes", stpIH->biSizeImage);
  wsprintf(ucValue[10], L"%d", stpIH->biXPelsPerMeter);
  wsprintf(ucValue[11], L"%d", stpIH->biYPelsPerMeter);
  wsprintf(ucValue[12], L"%d", stpIH->biClrUsed);
  wsprintf(ucValue[13], L"%d", stpIH->biClrImportant);

  for (uiYCnt = 0; uiYCnt < 14; ++uiYCnt)
  {  
    CreateWindow(L"static", ucTitle[uiYCnt], WS_CHILD | WS_VISIBLE | ES_RIGHT,
      XPOS, YPOS + ((SHEIGHT + YGAP)*uiYCnt), SWIDTH, SHEIGHT, hWnd, (HMENU)-1, g_hInst, NULL);    
    
    CreateWindow(L"edit", ucValue[uiYCnt], WS_CHILD | WS_VISIBLE | WS_BORDER | ES_READONLY | ES_CENTER,
      XPOS + SWIDTH + XGAP, YPOS + ((SHEIGHT + YGAP)*uiYCnt), SWIDTH, SHEIGHT, hWnd, (HMENU)-1, g_hInst, NULL);

  }
  return;
}

728x90