Re: BitBlt(,,,,,,,,dwRop)



"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


.



Relevant Pages

  • Re: Accessing clipboard from REXX DLL
    ... if it places a pointer into the clipboard. ... the VIO process should call DosGiveSharedMem with its own ... High memory has introduced some subtleties. ... What Clipboard format does Mozilla use? ...
    (comp.os.os2.programmer.misc)
  • Re: memcpy to PCI Adapter Memory
    ... I thus always dword align the destination before ... REP MOVSD in assembler code (which I don't use very often anymore ... >(i.e. checking for alignment, using largest word size possible), and others ... This is why a HAL routine to optimize memory moves ...
    (microsoft.public.development.device.drivers)
  • RE: Endless loop?
    ... clipboard and it eats up the memory. ... >>> Dim rngToSearch As Range ... >>> Dim rngFound As Range ...
    (microsoft.public.excel.programming)
  • RE: Copy range values in C#
    ... Excel.Worksheet activeWorksheet = ... activeWorksheet.get_Range(strTopSourceCell, strBottomSourceCell); ... The documentation for Range.Copysaid that if the destination argument was ... to be used after the clipboard has been loaded. ...
    (microsoft.public.excel.programming)
  • Copy range values in C#
    ... Excel.Worksheet activeWorksheet = ... activeWorksheet.get_Range(strTopSourceCell, strBottomSourceCell); ... The documentation for Range.Copysaid that if the destination argument was ... to be used after the clipboard has been loaded. ...
    (microsoft.public.excel.programming)