
BruNews
|
Pour faire fenetre, va voir sources deja publiees. Faut aussi de bons livres.
// donnees int cxClient, cyClient, cxDib, cyDib; BITMAPFILEHEADER* m_pbmfh; BITMAPINFO* m_pbmi; BYTE* m_pBits;
LRESULT CALLBACK AppWndProc(HWND hwnd, UINT mssg, WPARAM wParam, LPARAM lParam) { switch (mssg) { case WM_SIZE: cxClient = LOWORD(lParam); cyClient = HIWORD(lParam); return 0; case WM_PAINT: if(!m_pbmfh) return 0; HDC hdc; PAINTSTRUCT ps; hdc = BeginPaint(hwnd, &ps); switch(wShow) { case IDM_SHOW_NORMAL: SetDIBitsToDevice(hdc, 0, 0, cxDib, cyDib, 0, 0, 0, cyDib, m_pBits, m_pbmi, DIB_RGB_COLORS); break; case IDM_SHOW_CENTER: SetDIBitsToDevice(hdc, (cxClient - cxDib) / 2, (cyClient - cyDib) / 2, cxDib, cyDib, 0, 0, 0, cyDib, m_pBits, m_pbmi, DIB_RGB_COLORS); break; case IDM_SHOW_STRETCH: SetStretchBltMode(hdc, COLORONCOLOR); StretchDIBits(hdc, 0, 0, cxClient, cyClient, 0, 0, cxDib, cyDib, m_pBits, m_pbmi, DIB_RGB_COLORS, SRCCOPY); break; case IDM_SHOW_ISOSTRETCH: SetStretchBltMode(hdc, COLORONCOLOR); SetMapMode(hdc, MM_ISOTROPIC); SetWindowExtEx(hdc, cxDib, cyDib, 0); SetViewportExtEx(hdc, cxClient, cyClient, 0); SetWindowOrgEx(hdc, cxDib / 2, cyDib / 2, 0); SetViewportOrgEx(hdc, cxClient / 2, cyClient / 2, 0); StretchDIBits(hdc, 0, 0, cxDib, cyDib, 0, 0, cxDib, cyDib, m_pBits, m_pbmi, DIB_RGB_COLORS, SRCCOPY); break; } EndPaint(hwnd, &ps); return 0; case WM_COMMAND: etc, etc...
BruNews, ciao...
------------------------------- Réponse au message : -------------------------------
> Je travaille initialement en C, je dispose d'une image codée en RGB dans un buffer et je veux l'afficher a l ecran. > Pouvez vous me dire comment creer une fenetre et afficher l image dedans. > Je travaille sous WIN XP avec MS VS6 > merci
|