NSImageMBS class
Online Documentation - Statistics - FAQ - Plugin Parts (All, Dependencies) - Class hierarchy
New in Version
22.2
22.3
22.4
22.5
23.0
23.1
23.2
23.3
23.4
23.5
24.0
24.1
The list of the topics,
classes,
interfaces,
controls,
modules,
global methods by category,
global methods by name,
screenshots,
licenses
and examples.
Platforms to show: All Mac Windows Linux Cross-Platform
NSImageMBS class
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.
- 25 properties
- 50 methods
- method addRepresentation(img as NSImageRepMBS)
- method BMPRepresentation as Memoryblock
- method BMPRepresentationMT as Memoryblock
- method cancelIncrementalLoad
- method Constructor
- method Constructor(data as Memoryblock)
- method Constructor(file as folderitem)
- method Constructor(image as Picture, mask as picture = nil)
- method Constructor(width as Double, height as Double)
- method CopyMask as picture
- method CopyPicture(CGColorSpace as Variant = nil, BackgroundColor as NSColorMBS = nil) as picture
- method CopyPictureRect(x as Integer, y as Integer, w as Integer, h as Integer, CGColorSpace as Variant = nil, BackgroundColor as NSColorMBS = nil) as picture
- method CopyPictureWithAlpha as picture
- method CopyPictureWithAlphaRect(x as Integer, y as Integer, w as Integer, h as Integer) as picture
- method CopyPictureWithMask(CGColorSpace as Variant = nil) as picture
- method DrawIntoCGContextAtPoint(cgcontext as Integer, x as Double, y as Double, sx as Double, sy as Double, SourceW as Double, SourceH as Double, operation as Integer, fraction as Double) as boolean
- method DrawIntoCGContextAtRect(cgcontext as Integer, x as Double, y as Double, w as Double, h as Double, SourceX as Double, SourceY as Double, SourceW as Double, SourceH as Double, operation as Integer, fraction as Double) as boolean
- method GIFRepresentation as Memoryblock
- method GIFRepresentationMT as Memoryblock
- method imageByFadingToFraction(fraction as Double) as NSImageMBS
- method imageByScalingToSize(width as Double, height as Double) as NSImageMBS
- method imageByScalingToSize(width as Double, height as Double, fraction as Double) as NSImageMBS
- method imageByScalingToSize(width as Double, height as Double, fraction as Double, flip as boolean, proportionally as boolean) as NSImageMBS
- method imageWithSymbolConfiguration(configuration as NSImageSymbolConfigurationMBS) as NSImageMBS
- method imageWithTintColor(tintColor as NSColorMBS) as NSImageMBS
- method initWithContentsOfURL(file as folderitem) as boolean
- method initWithContentsOfURL(url as string) as boolean
- method initWithData(data as Memoryblock) as boolean
- method initWithDataIgnoringOrientation(data as Memoryblock) as boolean
- method initWithIconRef(IconHandle as Integer) as boolean
- method initWithPasteboard as boolean
- method initWithPicture(img as picture, mask as picture = nil) as boolean
- method initWithSize(width as Double, height as Double) as boolean
- method JPEGRepresentation as Memoryblock
- method JPEGRepresentationMT as Memoryblock
- method JPEGRepresentationWithCompressionFactor(factor as Double) as Memoryblock
- method JPEGRepresentationWithCompressionFactorMT(factor as Double) as Memoryblock
- method PNGRepresentation as Memoryblock
- method PNGRepresentationMT as Memoryblock
- method recache
- method removeRepresentation(img as NSImageRepMBS)
- method RepresentationHeight(index as Integer) as Integer
- method representations as NSImageRepMBS()
- method RepresentationWidth(index as Integer) as Integer
- method setName(value as String) as Boolean
- method setSize(width as Double, height as Double)
- method TIFFRepresentation as Memoryblock
- method TIFFRepresentationMT as Memoryblock
- method TIFFRepresentationUsingCompression(comp as Integer, factor as Double) as Memoryblock
- method TIFFRepresentationUsingCompressionMT(comp as Integer, factor as Double) as Memoryblock
- 160 shared methods
- 9 constants
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:
- DesktopNSCollectionViewControlMBS.draggingImageForItems(indexPaths() as NSIndexPathMBS, NSEvent as NSEventMBS, byref dragImageOffset as NSPointMBS) as NSImageMBS
- DesktopWKWebViewControlMBS.takeSnapshotCompleted(image as NSImageMBS, error as NSErrorMBS, tag as string)
- GameKitMBS.loadImageCompleted(description as GKAchievementDescriptionMBS, image as NSImageMBS, error as NSErrorMBS, tag as Variant)
- GameKitMBS.loadPhotoForSizeCompleted(player as GKPlayerMBS, size as Integer, photo as NSImageMBS, error as NSErrorMBS, tag as Variant)
- NSCollectionViewControlMBS.draggingImageForItems(indexPaths() as NSIndexPathMBS, NSEvent as NSEventMBS, byref dragImageOffset as NSPointMBS) as NSImageMBS
- NSSharingServiceDelegateMBS.transitionImageForShareItem(service as NSSharingServiceMBS, item as Variant, contentRect as NSRectMBS) as NSImageMBS
- QLPreviewPanelMBS.transitionImageForPreviewItem(file as folderitem, byref contentRect as NSRectMBS) as NSImageMBS
- WKWebViewControlMBS.takeSnapshotCompleted(image as NSImageMBS, error as NSErrorMBS, tag as string)
- WKWebViewIOSControlMBS.takeSnapshotCompleted(image as NSImageMBS, error as NSErrorMBS, tag as string)
Some examples using this class:
Blog Entries
Xojo Developer Magazine
- 6.4, page 34: Creating PDF Files, How to create PDFs using the MBS Plugins by Christian Schmitz
- 5.6, pages 32 to 33: Third Party Plugins: Statusitems, Getting an icon in the top right of the Mac OS X menubar by Christian Schmitz
- 20.3, page 80: Great Shots With Continuity Camera, Use your iOS device to take a picture for your Mac by Stefanie Juchmes
- 20.3, page 10: News
- 19.1, page 91: Maps Part 8, Implementing Maps in Xojo desktop apps with the MapKitMBS plugin by Markus Winter
- 19.1, page 82: Maps Part 8, Implementing Maps in Xojo desktop apps with the MapKitMBS plugin by Markus Winter
- 19.1, page 80: Maps Part 8, Implementing Maps in Xojo desktop apps with the MapKitMBS plugin by Markus Winter
- 19.1, page 78: Maps Part 8, Implementing Maps in Xojo desktop apps with the MapKitMBS plugin by Markus Winter
- 18.6, page 73: MapKit Part 7, Implementing Maps in Xojo desktop apps with the MapKitMBS plugin by Markus Winter
- 18.6, pages 68 to 69: MapKit Part 7, Implementing Maps in Xojo desktop apps with the MapKitMBS plugin by Markus Winter
Videos
Release notes
- 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