Board index » Visual Studio » Displaying a bitmap in a CView ..
|
Mubi
|
Displaying a bitmap in a CView ..
Visual Studio335
Hello all, I wish to display a bitmap in the CView instance associated with a document template in an MDI type application. To do this, I dynamically created a CStatic control as follows: CStatic* theFMSmall = new CStatic; BOOL theAnswer = theCPCaption->Create ("FM Samll", WS_CHILD|WS_VISIBLE|SS_BITMAP|SS_CENTERIMAGE, CRect (250, 170, 370, 240), this, ID_FMSMALLBM); theFMSmall->SetBitmap( ::LoadBitmap(NULL, MAKEINTRESOURCE (IDB_BM_FMSMALL))); theFMSmall->ShowWindow (SW_SHOW); I have used something rather similar to display static controls within CView instances that only contained text. If I remove the styles SS_BITMAP | SS_CENTERIMAGE, the text "FM Small" is displayed. The bitmap IDB_BM_FMSMALL exists. I am sure of that. If it didn't the code wouldn't compile properly. I have displayed this bitmap in some dialog boxes, so I know it is a good image. Am I doing something wrong? It is not possible to use a CStatic to display a resource derived bitmap in a CView instance? Is this a bug in VS .NET? Just wondering .. Harvey - |
