The following code worked for me. It does not contain MFC and can be used immediately to draw PNG images in a window.
Gdiplus::Image image(L"C:\\Logo.png") ; Gdiplus::Graphics* graphics = Gdiplus::Graphics::FromHDC(GetDC(hWnd)); RectF ImgRect(0,0,y3/10,y3/10) ; Gdiplus::Status result = graphics->DrawImage(&image, ImgRect);
Thanks for your support and quick response to solve my problem.
source share