This works great!
But...Code:case WM_PAINT: { PAINTSTRUCT ps; BeginPaint(hWndParent, &ps); Image img(L"png.png"); Graphics graphics(ps.hdc); graphics.DrawImage(&img, 1, 1); EndPaint(hWndParent, &ps); return TRUE; }
so.. hdc is different in each message... or am I using the wrong API?Code:WM_CREATE: { HDC hdc = GetDC(hWndParent); Image img(L"png.png"); Graphics graphics(hdc); graphics.DrawImage(&img, 1, 1); ReleaseDC(hWndParent, hdc); }