Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSGraphicsMBS class.

NSGraphicsMBS.NSCompositeClear=0

Type Topic Plugin Version
const Cocoa Drawing MBS MacCocoa Plugin 7.7
Transparent. (R = 0)

NSGraphicsMBS.NSCompositeCopy=1

Type Topic Plugin Version
const Cocoa Drawing MBS MacCocoa Plugin 7.7
Source image. (R = S)

NSGraphicsMBS.NSCompositeDestinationAtop=9

Type Topic Plugin Version
const Cocoa Drawing MBS MacCocoa Plugin 7.7
Destination image wherever both images are opaque, source image wherever source image is opaque but destination image is transparent, and transparent elsewhere. (R = S*(1 - Da) + D*Sa)

NSGraphicsMBS.NSCompositeDestinationIn=7

Type Topic Plugin Version
const Cocoa Drawing MBS MacCocoa Plugin 7.7
Destination image wherever both images are opaque, and transparent elsewhere. (R = D*Sa)

NSGraphicsMBS.NSCompositeDestinationOut=8

Type Topic Plugin Version
const Cocoa Drawing MBS MacCocoa Plugin 7.7
Destination image wherever destination image is opaque but source image is transparent, and transparent elsewhere. (R = D*(1 - Sa))

NSGraphicsMBS.NSCompositeDestinationOver=6

Type Topic Plugin Version
const Cocoa Drawing MBS MacCocoa Plugin 7.7
Destination image wherever destination image is opaque, and source image elsewhere. (R = S*(1 - Da) + D)

NSGraphicsMBS.NSCompositeHighlight=12

Type Topic Plugin Version
const Cocoa Drawing MBS MacCocoa Plugin 7.7
Source image wherever source image is opaque, and destination image elsewhere. (Deprecated. Mapped to NSCompositeSourceOver.)

NSGraphicsMBS.NSCompositePlusDarker=11

Type Topic Plugin Version
const Cocoa Drawing MBS MacCocoa Plugin 7.7
Sum of source and destination images, with color values approaching 0 as a limit. (R = MAX(0, (1 - D) + (1 - S)))

NSGraphicsMBS.NSCompositePlusLighter=13

Type Topic Plugin Version
const Cocoa Drawing MBS MacCocoa Plugin 7.7
Sum of source and destination images, with color values approaching 1 as a limit. (R = MIN(1, S + D))

NSGraphicsMBS.NSCompositeSourceAtop=5

Type Topic Plugin Version
const Cocoa Drawing MBS MacCocoa Plugin 7.7
Source image wherever both images are opaque, destination image wherever destination image is opaque but source image is transparent, and transparent elsewhere. (R = S*Da + D*(1 - Sa))

NSGraphicsMBS.NSCompositeSourceIn=3

Type Topic Plugin Version
const Cocoa Drawing MBS MacCocoa Plugin 7.7
Source image wherever both images are opaque, and transparent elsewhere. (R = S*Da)

NSGraphicsMBS.NSCompositeSourceOut=4

Type Topic Plugin Version
const Cocoa Drawing MBS MacCocoa Plugin 7.7
Source image wherever source image is opaque but destination image is transparent, and transparent elsewhere. (R = S*(1 - Da))

NSGraphicsMBS.NSCompositeSourceOver=2

Type Topic Plugin Version
const Cocoa Drawing MBS MacCocoa Plugin 7.7
Source image wherever source image is opaque, and destination image elsewhere. (R = S + D*(1 - Sa))

NSGraphicsMBS.NSCompositeXOR=10

Type Topic Plugin Version
const Cocoa Drawing MBS MacCocoa Plugin 7.7
Exclusive OR of source and destination images. (R = S*(1 - Da) + D*(1 - Sa))

Works only with black and white images and is not recommended for color contexts.

NSGraphicsMBS.NSImageInterpolationDefault=0

Type Topic Plugin Version
const Cocoa Drawing MBS MacCocoa Plugin 10.3
One of the interpolation contants.

Use the context's default interpolation.

NSGraphicsMBS.NSImageInterpolationHigh=3

Type Topic Plugin Version
const Cocoa Drawing MBS MacCocoa Plugin 10.3
One of the interpolation contants.

Slower, higher-quality interpolation.

NSGraphicsMBS.NSImageInterpolationLow=2

Type Topic Plugin Version
const Cocoa Drawing MBS MacCocoa Plugin 10.3
One of the interpolation contants.

Fast, low-quality interpolation.

NSGraphicsMBS.NSImageInterpolationMedium=4

Type Topic Plugin Version
const Cocoa Drawing MBS MacCocoa Plugin 10.3
One of the interpolation contants.

Medium quality, slower than NSImageInterpolationLow.
Available in Mac OS X v10.6 and later.

NSGraphicsMBS.NSImageInterpolationNone=1

Type Topic Plugin Version
const Cocoa Drawing MBS MacCocoa Plugin 10.3
One of the interpolation contants.

No interpolation.

NSGraphicsMBS.NSStringDrawingDisableScreenFontSubstitution = 4

Type Topic Plugin Version
const Cocoa Drawing MBS MacCocoa Plugin 11.3
One of the drawing option constants.

Disable screen font substitution (equivalent to NSLayoutManager.setUsesScreenFonts(false)).

NSGraphicsMBS.NSStringDrawingOneShot = 16

Type Topic Plugin Version
const Cocoa Drawing MBS MacCocoa Plugin 11.3
One of the drawing option constants.

Suppresses caching layout information.

NSGraphicsMBS.NSStringDrawingTruncatesLastVisibleLine = 32

Type Topic Plugin Version
const Cocoa Drawing MBS MacCocoa Plugin 11.3
One of the drawing option constants.

Truncates and adds the ellipsis character to the last visible line if the text doesn't fit into the bounds specified.
This option is ignored if NSStringDrawingUsesLineFragmentOrigin is not also set. In addition, the line break mode must be either NSLineBreakByWordWrapping or NSLineBreakByCharWrapping for this option to take effect. The line break mode can be specified in a paragraph style passed in the attributes dictionary argument of the drawing methods.
Available in Mac OS X v10.5 and later.

NSGraphicsMBS.NSStringDrawingUsesDeviceMetrics = 8

Type Topic Plugin Version
const Cocoa Drawing MBS MacCocoa Plugin 11.3
One of the drawing option constants.

Uses image glyph bounds instead of typographic bounds.

NSGraphicsMBS.NSStringDrawingUsesFontLeading = 2

Type Topic Plugin Version
const Cocoa Drawing MBS MacCocoa Plugin 11.3
One of the drawing option constants.

Uses the font leading for calculating line heights.

NSGraphicsMBS.NSStringDrawingUsesLineFragmentOrigin = 1

Type Topic Plugin Version
const Cocoa Drawing MBS MacCocoa Plugin 11.3
One of the drawing option constants.
Example
// create Hello World in red
dim a as NSAttributedStringMBS = NSAttributedStringMBS.attributedStringWithString("Hello World")
dim m as NSMutableAttributedStringMBS = a.mutableCopy

m.addAttribute(a.NSForegroundColorAttributeName, NSColorMBS.redColor, new NSRangeMBS(0, m.length))

// put it in a textarea
TextArea1.NSTextViewMBS.textStorage.setAttributedString m

// draw in Canvas
dim g as new NSGraphicsMBS(Canvas1.NSViewMBS)

g.drawWithRect m, new NSRectMBS(20,20, 100, 100), g.NSStringDrawingUsesLineFragmentOrigin

The specified origin is the line fragment origin, not the baseline origin.

The items on this page are in the following plugins: MBS MacCocoa Plugin.


💬 Ask a question or report a problem
The biggest plugin in space...