Solved

CStatic::SetBitmap for

Posted on 1998-07-16
2
493 Views
Last Modified: 2013-11-20
Hi, I think this is an easy question.  I am trying to set a bitmap into a CStatic object, using SetBitmap.  It works fine for resources, but I would like to use it for a bitmap I am creating on my own, and is continuously being updated with input from a camera.  I was using BitBlt, and this was working, but I wanted a way to refresh parts of the bitmap without having to blt all the time.  So I thought giving the bitmap to a static control, and letting it take care of the blitting and rectangle invalidations itself, and I just hand it the bitmap.  The bitmap is named mCaptureBmp (initialized with camera data with SetDIBits()) -- but instead of BitBlt(), I do mStcCapture.SetBitmap(mCaptureBmp);  I just get a blank static control.

What could be wrong?
0
Comment
Question by:jamin1
2 Comments
 
LVL 7

Expert Comment

by:psdavis
Comment Utility
Not an answer to what is wrong (probably not enough info), but have you tried SetDIBitsToDevice?  

This function will allow you to specify what segment of the image you want to display.  Also useful is StretchDIBitsToDevice.

At least people won't laught at you when you tell them how you did it... :)

Phillip

0
 
LVL 23

Accepted Solution

by:
chensu earned 50 total points
Comment Utility
Unfortunately, a static control does not support displaying a DIB. It converts the DIB to a DDB when displaying. Then all the color palette information is lost. So you got a black one. Don't use a static control in your case.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
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…
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.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

728 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

13 Experts available now in Live!

Get 1:1 Help Now