Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

CStatic::SetBitmap for

Posted on 1998-07-16
2
Medium Priority
?
516 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
ID: 1319353
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 100 total points
ID: 1319354
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.
Integration Management Part 2

876 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