Solved

PlgBlt(..)  transparency Parameter

Posted on 2000-04-17
1
514 Views
Last Modified: 2013-11-20
When using PlgBlt:

pDC->PlgBlt(currentImagePoints, &memDC, 0, 0, 66, 80, CBitmap(), 0, 0);

I get just an ordinary sprite (contained in the memDC).  But instead, i want to use the transparency mask parameter and replace the above CBitmap()  parameter with my monocrome mask.

The problem however is that it's not displaying the sprite at all whatsoever now.  When i try shrinking the size of the mask bitmap (so that it is smaller than the bitmap contained in memDC), the sprite to be displayed to the screen is still invisible!

The mask that i tried making was done as follows:
- Loaded Photoshop
- Opened the bimap that contains the sprite (red in the transparency area)
- went to mode and selected Grey Scale
- saved the bitmap with the name mask.bmp

The mask is specified to be monocrome in the MSDN library.

Could you give any suggestions as to why the sprite is always invisible no matter what?  What can i do to fix this?

- Thanks
0
Comment
Question by:Chains
1 Comment
 
LVL 30

Accepted Solution

by:
Zoppo earned 50 total points
ID: 2725661
Hi Chains,

>The mask is specified to be monocrome in the MSDN library.
That's correct and I think that may be your problem. 'monocrome' means 1 bit per pixel, only black/white. A grayscaled image may have 8bit or more.

BTW, what's the return value of the PlgBlt-call?

ZOPPO
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
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.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

758 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now