Y
Yan Yang
Guest
I am trying to load an image (GIF) from a file using GDI+ to be displayed in a static control, but the loaded image always points to NULL, I also tried to load a bitmap, the loaded image is also NULL.
Could you help me check if there is any problem in the code below? Thanks in advance.
HBITMAP ctrlBitmap(NULL);
LPCTSTR lpszResourceName = MAKEINTRESOURCE(IDB_THICKNESSZ);
ASSERT(lpszResourceName != NULL);
Gdiplus::Image *image = Gdiplus::Image::FromFile(lpszResourceName);
Gdiplus::Bitmap* pBitmap = static_cast<Gdiplus::Bitmap*>(image->Clone());
Gdiplus::Status status = pBitmap->GetHBITMAP(Gdiplus::Color(0, 0, 0), &ctrlBitmap);
GetParent()->GetPropertySheet()->SetControlImage(ctrlBitmap);
Continue reading...
Could you help me check if there is any problem in the code below? Thanks in advance.
HBITMAP ctrlBitmap(NULL);
LPCTSTR lpszResourceName = MAKEINTRESOURCE(IDB_THICKNESSZ);
ASSERT(lpszResourceName != NULL);
Gdiplus::Image *image = Gdiplus::Image::FromFile(lpszResourceName);
Gdiplus::Bitmap* pBitmap = static_cast<Gdiplus::Bitmap*>(image->Clone());
Gdiplus::Status status = pBitmap->GetHBITMAP(Gdiplus::Color(0, 0, 0), &ctrlBitmap);
GetParent()->GetPropertySheet()->SetControlImage(ctrlBitmap);
Continue reading...