Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Device Context / BitBlt / TransparentBlt and assembling scenes

Posted on 2005-04-21
Medium Priority
Last Modified: 2013-11-20
My scenario is like this.  I have a stream of 1000x1000 bitmaps coming in from hardware.  I created a class COverlay that implements its own memory DC, and there are several derived COverlay's, each one knows how to draw itself.

I've done it like this because the overlays don't need to be redrawn frame-by-frame, so I draw them once into their memory DC, and then when I need to apply the overlay to the stream of frames, I can just Blt the overlay to the frame.

Not quite so simple.  Let me describe the problem.  If I create a memory surface and fill it with black, and then proceed to draw my overlay material into that, I can't just do a BitBlt onto the frame surface, using SRCCOPY because then all I see is a black frame with the overlay drawing.

My inclination is to fill the background of my memory surface with an odd color that isn't used elsewhere, and then do a transparent blt. I think that would work but I can't help but think there is a more appropriate way.   Is there a dwRop flag that I'm missing?   My need is simple, allow me to maintain a memory DC that has infrequently changed drawings in it, and overlay that DC transparently onto an incoming stream of bitmaps. That being said, Is TransparentBlt the answer or something more suitable?

Question by:PMH4514
  • 2

Accepted Solution

NawalKishore1976 earned 200 total points
ID: 13840536

Expert Comment

ID: 13840540

Author Comment

ID: 13841432
interesting. they both have ways of drawing transparent images w/o TransparentBlit()

is TransparentBlt() inefficient?

I currently fill my mem DC with a globally defined transparency colorref, draw over top that, and then TransparentBlt() my mem DC (the affected region within it at least) to the composite DC.

it seems to work ok, but it's just a *bit* sluggish

of course I am dealing with two 15fps streams of 1000x1000 32bit images into which I'm overlaying composits, this I'm sure is creating a performance hit (time to look at higher end video cards!) - which is why I'm looking for ways to optimize.

those codeproject links are both interesting, but not very useful in that they basically do what I'm doing.

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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 …
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Suggested Courses
Course of the Month11 days, 2 hours left to enroll

571 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