Solved

Bitmaps from resources won't show

Posted on 1997-07-29
4
221 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Change owner from userA to server Local Administrators 7 51
fizzArray  challenge 1 47
canBalance challenge 34 65
wordcount challenge 11 73
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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…

772 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

11 Experts available now in Live!

Get 1:1 Help Now