Solved

PlgBlt(..)  transparency Parameter

Posted on 2000-04-17
1
521 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 31

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

912 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

25 Experts available now in Live!

Get 1:1 Help Now