Solved

Bitmaps from resources won't show

Posted on 1997-07-29
4
224 Views
Last Modified: 2013-12-03
Hi

I have a dialog that has a CStatic bitmap control and I need to load one of four bitmaps to the control run-time.

I have tried to do it with CBitmap objects and CStatic::SetBitmap commands, but the bitmap would just not show. The bitmaps are 50 x 20 x 16 colors.
The dialog class has member variables for the four bitmaps and the CStatic control and I used DDX.

I am using MS VC++ 4.2 on NT 3.51 and the dialogs are created with Resource editor+ClassWizard

Any suggestions?
0
Comment
Question by:vake
  • 2
4 Comments
 
LVL 4

Accepted Solution

by:
AVaulin earned 100 total points
ID: 1302913
Be sure that you use SS_BITMAP style ie you have to add Picture control to dialog and set Bitmap type in general control properties. Also you can create this control dynamicaly at run time with CStatic::Create method (be sure to use SS_BITAMP style).
Good luck.
0
 

Author Comment

by:vake
ID: 1302914
The control is SS_BITMAP, the problem is that according to the MFC help, I have used the proper procedure. Of course I do not use any fancy BitBlt operations, just because I think I do not need to (no 256 or special palettes).
I had the same trouble with AVI animations, if I loaded them from a file they worked fine, but if I loaded them from a resource they would not work. The CAnimateCtrl::Open succeeded, but Play did not show anything...
0
 

Author Comment

by:vake
ID: 1302915
The control is SS_BITMAP, the problem is that according to the MFC help, I have used the proper procedure. Of course I do not use any fancy BitBlt operations, just because I think I do not need to (no 256 or special palettes).
I had the same trouble with AVI animations, if I loaded them from a file they worked fine, but if I loaded them from a resource they would not work. The CAnimateCtrl::Open succeeded, but Play did not show anything...
0
 

Expert Comment

by:quosta
ID: 1302916
I wish I had the answer to this one too.  I'm trying to create a bitmap/static control.  From what I've read, it should read from file and display. But, it doesn't.  If you get the answer to this one, please let me know.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

943 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now