Platforms to show: All Mac Windows Linux Cross-Platform

NSImageMBS class

Type Topic Plugin Version macOS Windows Linux iOS Targets
class Cocoa Drawing MBS MacBase Plugin 7.2 ✅ Yes ❌ No ❌ No ✅ Yes All
An NSImage object is a high-level class for manipulating image data.

You use this class to load existing images or create new ones and composite them into a view or other image. This class works in conjunction with one or more image representation objects (subclasses of NSImageRep), which manage the actual image data.

All methods in this class will catch exceptions from Cocoa and raise a NSExceptionMBS instead. Using the message, name and reason properties you can see what was the reason for this exception. Please report if you find a method which does not handle exceptions correct.

Image Cache Modes

Constant Value Description
NSImageCacheAlways 1 Always generate a cache when drawing.
NSImageCacheBySize 2 Cache if cache size is smaller than the original data.
NSImageCacheDefault 0 Caching is unspecified.
Use the image rep's default.
NSImageCacheNever 3 Never cache; always draw direct.

Image Load Status

Constant Value Description
NSImageLoadStatusCancelled 1 Image loading was canceled.
The image contains the portions of the data that have already been successfully decompressed, if any.
NSImageLoadStatusCompleted 0 Enough data has been provided to completely decompress the image.
NSImageLoadStatusInvalidData 2 An error occurred during image decompression.
The image data is probably corrupt. The image contains the portions of the data that have already been successfully decompressed, if any.
NSImageLoadStatusReadError 4 Not enough data was available for full decompression of the image.
The image contains the portions of the data that have already been successfully decompressed, if any.
NSImageLoadStatusUnexpectedEOF 3 Not enough data was available for full decompression of the image.
The image contains the portions of the data that have already been successfully decompressed, if any.

This class has no sub classes.

Some useful global functions for this class:

Some methods using this class:

Some properties using for this class:

Some events using this class:

Some examples using this class:

Blog Entries

Xojo Developer Magazine

Videos

Release notes

  • Version 24.4
  • Version 22.4
  • Version 20.5
    • Added imageWithSystemSymbolName method to NSImageMBS class to get SF Symbols.
  • Version 20.1
  • Version 18.4
  • Version 18.3
    • Changed NSImageMBS.CopyPictureWithMask to return mask, even if image representation is not marked to have alpha.
  • Version 17.4
    • Added exceptions for NSImageMBS constructors. You'll get an UnsupportedOperationException if image creation fails.

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


NSImageCellMBS   -   NSImageRepMBS


The biggest plugin in space...