BitBlt transparancy question?

This is a discussion on BitBlt transparancy question? within the Windows Programming forums, part of the Platform Specific Boards category; I've been searchin for 3 hours now with no result so I figured it was time to ask.. I have ...

  1. #1
    btq
    btq is offline
    julie lexx... btq's Avatar
    Join Date
    Jun 2002
    Posts
    161

    BitBlt transparancy question?

    I've been searchin for 3 hours now with no result so I figured it was time to ask..
    I have a color bitmap, picturing a dog on a blue background.
    The window, which I want to copy the dog into, pictures a nice lawn with many many nice green trees.
    The question is, can I copy the dog into the window *without* changing the background, that is, everything blue in the bitmap with the dog will not contribute to anything in the window it is copied into...
    I mean as a result I will have a nice picture of a dog walkin around in the park, and not a park and a "cut in" dog in a little square in the middle...?

    ...cause this is all I get from the BitBlt-func.

    thanks a bunch

    /btq

  2. #2
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    Yes you can. You need to create a monochrome mask of the source bitmap, either separately or programmatically, blit the mask first using the SRCAND flag for the last parameter of BitBlt and then BitBlt the source image with the SRCPAINT flag.

    Hope that helps.

  3. #3
    btq
    btq is offline
    julie lexx... btq's Avatar
    Join Date
    Jun 2002
    Posts
    161
    he..thanks man. that did help!

    /btq

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Question about pointers #2
    By maxhavoc in forum C++ Programming
    Replies: 28
    Last Post: 06-21-2004, 12:52 PM
  2. Question...
    By TechWins in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 07-28-2003, 09:47 PM
  3. opengl DC question
    By SAMSAM in forum Game Programming
    Replies: 6
    Last Post: 02-26-2003, 08:22 PM
  4. Question about linked lists.
    By cheeisme123 in forum C++ Programming
    Replies: 6
    Last Post: 02-25-2003, 12:36 PM
  5. Question, question!
    By oskilian in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 12-24-2001, 12:47 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21