Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Bitmaps from resources won't show

Posted on 1997-07-29
4
Medium Priority
?
246 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
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…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

722 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