Home

SRCINVERT

SRCINVERT is one of the predefined raster-operation (ROP) codes used by the Windows Graphics Device Interface (GDI) in functions such as BitBlt and StretchBlt. It specifies a per-pixel boolean operation where the resulting destination pixel is computed as the exclusive OR (XOR) of the corresponding source and destination pixels, effectively performing D' = S XOR D.

In practical terms, SRCINVERT toggles the destination pixels wherever the source pixels are set. If a source

SRCINVERT is commonly used for simple masking, stamping, or creating inverted overlays in legacy Windows graphical

Limitations include its dependence on bitwise operations rather than alpha blending, which makes it less suitable

See also: SRCCOPY, DSTINVERT, SRCAND, SRCPAINT, XOR-based operations, Windows GDI raster operations.

bit
is
0,
the
destination
remains
unchanged;
if
a
source
bit
is
1,
the
destination
bit
is
inverted.
The
exact
visual
effect
depends
on
the
bitmap
formats
and
color
depth
of
the
source
and
destination,
since
the
operation
is
applied
bitwise
across
the
bitmap
data.
workflows.
It
can
be
leveraged
to
highlight,
erase,
or
“cut
out”
regions
of
a
destination
bitmap
by
applying
a
source
mask,
though
its
results
can
be
unintuitive
with
complex
color
images
or
alpha
channels.
for
modern,
high-quality
compositing.
It
is
primarily
encountered
in
older
GDI-based
applications
or
in
scenarios
requiring
compatibility
with
16-bit
or
32-bit
bitmaps
and
the
fixed
set
of
predefined
ROP
codes.