I've seen the documentation in MSDN on the ROPs.Can someone give me a detailed explanations on the various common ROPs, like SRCCOPY, SRCAND, SRCINVERT etc, in the form like

src =
blue background + red text

destination = black bg + yellow text


result == ???

Thanks :)
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

For detailed explanation, see

Ternary Raster Operations

For results, writing a simple testing program to try it out may be better and more accurate.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
RodneyYeoAuthor Commented:
I've already seen that page :)
But it's very confusing. Any way to make it simpler to understand
Jan LouwerensSoftware EngineerCommented:
BitBlt doesn't distinguish between backgrounds or text. It's a bit by bit block transfer of one section of memory to another (for flipping images to the screen, or copying sections of the screen to another location on the screen).

SRCCOPY = an exact duplicate of the source is copied to the destination

SRCAND = the bits of the source are bitwise ANDed with the bits of the destination

SRCINVERT = the source is "inverted" as it is copied to the destination. ("inverted" meaning that the "opposite" colors will be diplayed - sorry, not being an expert in color theory, my explanation of this can't be any better)
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

RodneyYeoAuthor Commented:
If I have a bitmap with a green background with a red circle in the centre, how can i make the background look transparent? Can you explain your answer. THanks :)
Transparent Bitmap - True Mask Method
RodneyYeoAuthor Commented:
I've seen the code that you have suggested..just a question..why do you have to do these 2 lines?

dcTrans.BitBlt(0, 0, nWidth, nHeight, &dcImage, 0, 0, SRCCOPY);

That is to build a monochrome mask based on the transparent color. dcTrans is a monochrome DC while dcImage is a color DC that contains the original bitmap. When BitBlting a color bitmap to a monochrome bitmap, it sets pixels that match the background color of the color DC to white (1) and sets all other pixels to black (0).
RodneyYeoAuthor Commented:
Thanks. I think I'm have a better understanding now.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.