Solved

PlgBlt(..)  transparency Parameter

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Suggested Solutions

Title # Comments Views Activity
Generic progress indicator 6 117
fizzArray2 challenge 1 91
has77  challenge 9 90
Capture logon name 13 87
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
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. …
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.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

860 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