I have postponed discussing what Visual Basic documentation calls opcodes and the Windows API documentation calls ROPs (raster operations). I don’t know the official pronunciation, but I like to think of them as “ropes,” for no good reason. Whatever the name, ROPs are binary encodings that indicate how these three elements will be combined: the source picture, the destination background, and any pattern on the destination background.
Pictures are made up of pixels, and pixels are made up of bits. You combine bits with logical operators: AND, OR, XOR, NOT, and COPY. ROPs specify which logical operators will be used to combine (or not combine) the bits of the source, destination, and pattern. There are 15 named combinations, about seven more than you’ll ever need. This chapter uses only vbSrcCopy, vbSrcAnd, vbSrcPaint, vbNotSrcErase, vbDstInvert, vbSrcInvert, and vbMergePaint. You can see all of them as RasterOpConstants in the VBRUN library in the Object Browser.
ROP codes are actually hexadecimal numbers, indicating 256 possible combinations of destination, source, and pattern with NOT, AND, OR, XOR, and COPY operators. Most have no practical use. For example, you probably won’t need the combination that copies the destination onto itself. You can find the 256 combinations by searching for Ternary Raster Operations in MSDN. Incidentally, PaintPicture accepts all 256 combinations, not just the 15 named ones.