Title Banner

Previous Book Contents Book Index Next

Newton Developer Technical Information: Newton Programmer's Guide: 2.1 OS Addendum /
Chapter 6 - Drawing and Graphics 2.1 / Drawing and Graphics Reference
Constants


Transfer Mode Constants

The transfer mode constants are used as values to the style frame slot transferMode, and the view slot viewTransferMode. For more information on how these are used, see "Gray Transfer Modes".

modeCopy
The source pixel is drawn over the destination pixel.

modeOr
Non-white pixels are drawn over the destination pixels, but the destination pixels under white pixels are left untouched.

modeXor
The pixels are combined with a bitwise XOR, exclusive or, operation. This can create unexpected results when used with mid-level grays. For example, the result of combining a 0xA pixel (75% gray) with a 0x7 pixel (about 50% gray) is Bxor(0xA,0x7) = 0xD which is a dark gray. This mode is most often used with a black and white source image. The black pixels invert the destination pixels and the white pixels have no effect on the destination bitmap.

modeBic
The pixels are combined with a bitwise BIC, bit clear, operation. The BIC operation's truth table is show in Table 6-1.

This mode is most useful when using a black source image to erase the destination bitmap. It is also useful when drawing white text on a dark background, set the textPattern or fillPattern slots for the text to black. It can have strange effects when combining two gray pixels. For example, source 0xA and destination 0xB produce 0x1, but source 0xA and destination 0x5 produce 0x5.

modeNotCopy
The source image is inverted and then merged with destination bitmap using modeCopy.

modeNotOr
The source image is inverted and then merged with destination bitmap using modeOr.

modeNotXor
The source image is inverted and then merged with destination bitmap using modeXor.

modeNotBic
The source image is inverted and then merged with destination bitmap using modeBic.

modeMask
The bitmap's mask is drawn with modeBic, then the "normal" bitmap image is drawn in modeOr.

Table 6-1 Truth table for modeBic
SourceDestinationBIC
000
011
100
110

Previous Book Contents Book Index Next

© Apple Computer, Inc.
26 APR 1997



Navigation graphic, see text links

Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help