Cannot get CBitmap displayed in Picture Control

I try to display a jpeg file on image control, first upload it using GDIpluse, then I convert it to CBitmap after that, I tried to put it in a Picture control named m_picture_control , which is defined as CStatic in my dialog, but it does not appear

 Bitmap* pBitmap = Bitmap::FromFile(FileDlg.GetPathName()); Status status = pBitmap->GetLastStatus(); if(Ok == status) { HBITMAP hBitmap = NULL; status = pBitmap->GetHBITMAP(Color(0,0,0), &hBitmap); if(Ok == status) { CBitmap* bitmap = new CBitmap(); bitmap->Attach(hBitmap); m_picture_control.SetBitmap(*bitmap); } 
+4
source share

All Articles