Transfer Modes
Transfer Modes defined constants
#include <Quickdraw.h>
This shows the effect of the “source transfer” modes when drawing text on various
patterns; ie, calling TextMode(n ), followed by DrawChar('A'). The same effects
are seen in bit transfer operations, such as CopyBits and CopyMask.
For some reason, there is a separate set of transfer mode constants for
line-drawing and paint operations. At the bit- level, these “pattern transfer”
modes function the same as the source transfer modes. The next figure shows the
effect of using these pattern transfer modes. The samples were created by filling a
rectangle with a background pattern (FillRect), setting the transfer mode via
PenMode(n ), and painting an oval with a brick-work pattern (PaintOval).
The values of the Quickdraw transfer mode constants are:
srcCopy 0 overwrite background entirely
srcOr 1 overwrite where character (or source bitmap) is black
srcXor 2 invert where character (or source bitmap) is black
srcBic 3 force white where character (or source bitmap) is black
notSrcCopy 4 invert character (or source bitmap), then srcCopy
notSrcOr 5 invert character (or source bitmap), then srcOr
notSrcXor 6 invert character (or source bitmap), then srcXor
notSrcBic 7 invert character (or source bitmap), then srcBic
patCopy 8 overwrite background entirely
patOr 9 overwrite where pattern is black
patXor 10 invert where pattern and background are both black
patBic 11 force white where pattern is black
notPatCopy 12 invert pen pattern, then patCopy
notPatOr 13 invert pen pattern, then patOr
notPatXor 14 invert pen pattern, then patXor
notPatBic 15 invert pen pattern, then patBic
When using old-model colors via ForeColor and BackColor, most of these
operations remain intuitive. Instead of forcing white, an operation changes a pixel
to the current background color; instead of forcing black, the operation changes a
pixel to the current foreground color. The effect of an “ invert” operation depends
on the hardware in use.