I have to learn C# due to the need of my company. If I resist it, may I be able to be fired. Now, under the circumstance
of the economic crisis, losting job is not a good thing.
Both the altered image bitmap and the mask bitmap are selected into memory device contexts. Two BitBlt calls perform the magic.
The first does a BitBlt of the mask bitmap on the window:
BitBlt (hdc, x, y, cxBitmap, cyBitmap, hdcMemMask, 0, 0, 0x220326) ;
This uses a raster operation for which there is no name. The logical operation is D & ~S. Recall that the source-the mask bitmap
is a white ellipse (1 bits) surrounded by black (0 bits). The raster operation inverts the source so that it's a black ellipse
surrounded by white. The raster operation then performs a bitwise AND of this inverted source with the destination the surface of
the window. When the destination is ANDed with 1 bits, it remains unchanged. When ANDed with 0 bits, the destination becomes black.
Thus, this BitBlt operation draws a black ellipse in the window.
The second BitBlt call draws the image bitmap on the window:
BitBlt (hdc, x, y, cxBitmap, cyBitmap, hdcMemImag, 0, 0, SRCPAINT) ;
The raster operation performs a bitwise OR operation between the source and the destination. The outside of the source bitmap is black,
so it leaves the destination unchanged. Within the ellipse, the destination is black, so the image is copied unchanged.
of the economic crisis, losting job is not a good thing.
Both the altered image bitmap and the mask bitmap are selected into memory device contexts. Two BitBlt calls perform the magic.
The first does a BitBlt of the mask bitmap on the window:
BitBlt (hdc, x, y, cxBitmap, cyBitmap, hdcMemMask, 0, 0, 0x220326) ;
This uses a raster operation for which there is no name. The logical operation is D & ~S. Recall that the source-the mask bitmap
is a white ellipse (1 bits) surrounded by black (0 bits). The raster operation inverts the source so that it's a black ellipse
surrounded by white. The raster operation then performs a bitwise AND of this inverted source with the destination the surface of
the window. When the destination is ANDed with 1 bits, it remains unchanged. When ANDed with 0 bits, the destination becomes black.
Thus, this BitBlt operation draws a black ellipse in the window.
The second BitBlt call draws the image bitmap on the window:
BitBlt (hdc, x, y, cxBitmap, cyBitmap, hdcMemImag, 0, 0, SRCPAINT) ;
The raster operation performs a bitwise OR operation between the source and the destination. The outside of the source bitmap is black,
so it leaves the destination unchanged. Within the ellipse, the destination is black, so the image is copied unchanged.