Solved

CStatic::SetBitmap for

Posted on 1998-07-16
2
512 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
[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 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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone 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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

617 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