BitBlt

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

using SRCINVERT

result == ???

Thanks :)
RodneyYeoAsked:
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.

chensuCommented:
For detailed explanation, see

Ternary Raster Operations
http://msdn.microsoft.com/library/psdk/gdi/pantdraw_6n77.htm

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

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
0
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)
0
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 :)
0
chensuCommented:
Transparent Bitmap - True Mask Method
http://www.codeguru.com/bitmap/CISBitmap.shtml
0
RodneyYeoAuthor Commented:
I've seen the code that you have suggested..just a question..why do you have to do these 2 lines?

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

0
chensuCommented:
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).
0
RodneyYeoAuthor Commented:
Thanks. I think I'm have a better understanding now.
0
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.