Solved

CStatic::SetBitmap for

Posted on 1998-07-16
2
506 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 50 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.

820 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