I have a MFC Application with Dialog Based. I created a GDI+ Object from resource by using this.
MyDlg.cpp:
BOOL CSetupDlg::OnInitDialog()
{
Gdiplus::GdiplusStartupInput gdiplusStartupInput;
Gdiplus::GdiplusStartup(&m_gdiplusToken, &gdiplusStartupInput, NULL);
...
}
void MyFunction():
CGdiPlusBitmapResource* pBitmap = new CGdiPlusBitmapResource;
if (pBitmap->Load(ID_SPL_LG))
{
CPaintDC dc(this);
Gdiplus::Graphics graphics(dc);
graphics.DrawImage(*pBitmap, 0, 0);
//It is loaded . I checked with messagebox and its in here.
}
Invalidate(); //Not sure if necessary.
Now, Form/Dialog shows nothing. No image inserted nor attached.
Now, i tried few things to add this image to the dialog but i am unable to do it.
What i tried is GDIObject.Create()
, CStatic.Create()
and PictureControl.Create()
All i want to do is insert this image to the dialog.
Any idea or showing path is appreciated.
CPaintDC
in response to aWM_PAINT
message, otherwise it won't work. – Mark Ransom