Uitleg over de functie BitBlt:
A raster operation code determines how the colors of the pixels in the source are combined with the colors of the pixels in the destination. This parameter can be one value from the table.
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
| Value Description
BLACKNESS Fills the pixels in the specified rectangle in the destination
with the color in index 0 of the physical palette. By default,
this color is black.
DSTINVERT Inverts the colors of the pixels in the specified rectangle in
the destination.
MERGECOPY Combines the pixel colors of the source rectangle with the
pixel colors of the pattern contained in the brush selected
into the destination device context using the boolean AND
operator.
MERGEPAINT Inverts the pixel colors of the source rectangle and combines
them with the pixel colors of the destination rectangle using
the boolean OR operator.
NOTSRCCOPY Inverts the pixel colors of the source rectangle and copies
them into the destination rectangle.
NOTSRCERASE Combines the pixel colors of the source and destination
rectangles using the boolean OR operator, then inverts the
resulting color.
PATCOPY Copies the pattern contained in the brush selected into the
destination device context directly into the destination.
PATINVERT Combines the pixel colors of the pattern contained in the
brush selected into the destination device context with the
colors of the pixels in the destination using the boolean XOR
operator.
PATPAINT Combines the colors of the pattern contained in the brush
selected into the destination device context with the
inverted pixel colors of the source rectangle using the
boolean OR operator, then combines the result with the
pixel colors of the destination rectangle using the boolean
OR operator.
SRCAND Combines the pixel colors of the source and destination
rectangles using the boolean AND operator.
SRCCOPY Copies the pixel colors of the source rectangle directly into
the destination rectangle.
SRCERASE Combines the pixel colors of the source rectangle with the
inverted colors of the destination rectangle using the
boolean AND operator.
SRCINVERT Combines the pixel colors of the source and destination
rectangles using the boolean XOR operator.
SRCPAINT Combines the pixel colors of the source and destination
rectangles using the boolean OR operator.
WHITENESS Fills the pixels in the specified rectangle in the destination
with the color in index 255 of the physical palette. By
default, this color is white. |
Waar jij op doelt, is waarschijnlijk SRCINVERT (of
Source XOR Destination). Wat een XOR operatie doet is het volgende (uitgaande van zwart-witafbeeldingen):
- Als een bepaalde pixel in bron A en bron B gelijk is, komt er een zwarte pixel in op die plaats in de gecombineerde afbeelding.
- Als een bepaalde pixel in bron A en bron B ONgelijk is, komt er een witte pixel in op die plaats in de gecombineerde afbeelding.
Op de gecombineerde afbeelding verschijnt hierdoor vanzelf een wit plaatje van wat er verschillend is in beide bronafbeeldingen. Wat in beide bronafbeeldingen gelijk is, wordt zwart. Voor kleurenplaatjes is het iets ingewikkelder, maar het principe blijft hetzelfde.
Een goede grap mag vrienden kosten.