?
Solved

CStatic::SetBitmap for

Posted on 1998-07-16
2
Medium Priority
?
513 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 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

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

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

Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

718 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