Re: BitBlt(,,,,,,,,dwRop)
- From: "John Carson" <jcarson_n_o_sp_am_@xxxxxxxxxxxxxxx>
- Date: Thu, 16 Mar 2006 23:41:38 +1100
"William" <port@xxxxxxxxxxxxxxxxxx> wrote in message
news:OaCWBSzRGHA.5780@xxxxxxxxxxxxxxxxxxxx
Env: VC++6.00
I am making bitmap(8bit depth DIB format) pasting operation from
clipboard to my app.
One of pasting mode I need is as follows,
only these positions whose color = 0 on destination bitmap will be
changed by source bitmap(here is clipboard).
That is to say, if color != 0, color will keep unchanged.
Can I do that by BitBlt(,,,,,,,,dwRop)?
If yes, how should I set dwRop parameter?
TIA
William
I don't believe BitBlt can do it directly.
What you could do is the following. Get the "destination" bitmap and the
"source" bitmap into memory device contexts (making whatever conversions are
necessary). Then use TransparentBlt to copy from the "destination" memory DC
to the "source" memory DC using black as the transparent color. The result
of this will be that the "source" memory DC has the "destination's"
non-black pixels and retains its own pixels where the "destination" is
black. This would seem to be the combination you are after.
For Windows version where TransparentBlt doesn't exist or leaks memory, you
can use the following workaround:
http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B79212
--
John Carson
.
- Follow-Ups:
- Re: BitBlt(,,,,,,,,dwRop)
- From: William
- Re: BitBlt(,,,,,,,,dwRop)
- References:
- BitBlt(,,,,,,,,dwRop)
- From: William
- BitBlt(,,,,,,,,dwRop)
- Prev by Date: Re: Obtaining Info about a window from its HWND?
- Next by Date: Re: Getting the correct size of a glyph in a font
- Previous by thread: BitBlt(,,,,,,,,dwRop)
- Next by thread: Re: BitBlt(,,,,,,,,dwRop)
- Index(es):
Relevant Pages
|