Platforms to show: All Mac Windows Linux Cross-Platform
Back to NSImageMBS class.
NSImageMBS.canInitWithPasteboard as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa Drawing | MBS MacBase Plugin | 9.6 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
This method uses the NSImageRep class method imageUnfilteredPasteboardTypes to find a class that can handle the data in the specified pasteboard. If you create your own NSImageRep subclasses, override the imageUnfilteredPasteboardTypes method to notify NSImage of the pasteboard types your class supports.
NSImageMBS.imageFileTypes as string()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa Drawing | MBS MacBase Plugin | 12.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
An array of strings, each of which identifies a single supported file type. The array can include encoded HFS file types as well as filename extensions.
This list includes all file types supported by registered subclasses of NSImageRep plus those that can be converted to a supported type by a user-installed filter service. You can pass the array returned by this method directly to NSOpenPanelMBS.
When creating a subclass of NSImageRep, do not override this method. Instead, override the imageUnfilteredFileTypes method to notify NSImage of the file types your class supports directly.
NSImageMBS.imageNamed(name as string) as NSImageMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa Drawing | MBS MacBase Plugin | 8.4 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
This method searches for named images in several places, returning the first image it finds matching the given name. The order of the search is as follows:
1. Search for an object whose name was set explicitly using the setName: method and currently resides in the image cache.
2. Search the application's main bundle for a file whose name matches the pecified string. (For information on how the bundle is searched, see "Searching for Bundle Resources" in Bundle Programming Guide.)
3. Search the Application Kit framework for a shared image with the specified name.
When looking for files in the application bundle, it is better (but not required) to include the filename extension in the name parameter. When naming an image with the setName method, it is also convention not to include filename extensions in the names you specify. That way, you can easily distinguish between images you have named explicitly and those you want to load from the application's bundle.
One particularly useful image you can retrieve is your application's icon. This image is set by Cocoa automatically and referenced by the string "NSApplicationIcon". Icons for other applications can be obtained through the use of methods declared in the NSWorkspace class. You can also retrieve some standard system images using Cocoa defined constants; for more information, see the Constants section of this class.
If an application is linked in Mac OS X v10.5 or later, images requested using this method and whose name ends in the word "Template" are automatically marked as template images.
The NSImage class keeps a reference to any named images in a table until the image name is cleared. Consequently you do not need to retain the returned image object unless its name could be cleared. You can clear an image object from the table by passing nil to the setName: method of the corresponding NSImage object.
Here is a good list of identifiers you can use:
http://hetima.github.io/fucking_nsimage_syntax/
Some examples using this method:
NSImageMBS.imagePasteboardTypes as string()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa Drawing | MBS MacBase Plugin | 12.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Returns an array of strings, each of which identifies a single supported pasteboard type. By default, this list contains the NSPDFPboardType, NSPICTPboardType, NSPostScriptPboardType, and NSTIFFPboardType types.
This list includes all pasteboard types supported by registered subclasses of NSImageRep plus those that can be converted to a supported type by a user-installed filter service.
When creating a subclass of NSImageRep, do not override this method. Instead, override the imageUnfilteredPasteboardTypes method to notify NSImage of the pasteboard types your class supports.
NSImageMBS.imageTypes as string()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa Drawing | MBS MacBase Plugin | 12.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Returns an array of strings, each of which contains a UTI identifying a supported image type. Some sample image-related UTI strings include "public.image", "public.jpeg", and "public.tiff". For a list of supported types, see UTCoreTypes.h.
The returned list includes UTIs all file types supported by registered subclasses of NSImageRep plus those that can be converted to a supported type by a user-installed filter service. You can use the returned UTI strings with any method that supports UTIs.
You should not override this method directly. Instead, you should override the imageTypes method of NSImageRep.
Available in Mac OS X v10.5 and later.
NSImageMBS.imageUnfilteredFileTypes as string()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa Drawing | MBS MacBase Plugin | 12.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
An array of strings, each of which identifies a single supported file type. File types are identified by file extension and HFS file types.
The returned list does not contain pasteboard types that are available only through a user-installed filter service.
NSImageMBS.imageUnfilteredPasteboardTypes as string()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa Drawing | MBS MacBase Plugin | 12.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
An array of strings, each of which identifies a single supported pasteboard type.
The returned list does not contain pasteboard types that are supported only through a user-installed filter service.
NSImageMBS.imageUnfilteredTypes as string()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa Drawing | MBS MacBase Plugin | 12.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Returns an array of strings, each of which contains a UTI identifying a supported image type. Some sample image-related UTI strings include "public.image", "public.jpeg", and "public.tiff". For a list of supported types, see UTCoreTypes.h.
The returned list includes UTI strings only for those file types that are supported directly by registered subclasses of NSImageRep. It does not include types that are supported through user-installed filter services. You can use the returned UTI strings with any method that supports UTIs.
You should not override this method directly. Instead, you should override the imageUnfilteredTypes method of NSImageRep.
NSImageMBS.imageWithCGImage(CGImage as Variant, width as Double = 0, height as Double = 0) as NSImageMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa Drawing | MBS MacBase Plugin | 13.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
If width is zero, we take the width from the CGImage.
If height is zero, we take the height from the CGImage.
cgImage: The source CGImageMBS object.
width & height: The size of the new image.
Returns an initialized NSImage instance, or nil if the new instance cannot be initialized.
You should not assume anything about the image, other than that drawing it is equivalent to drawing the CGImage.
Available in OS X v10.6 and later.
NSImageMBS.imageWithContentsOfFile(file as folderitem) as NSImageMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa Drawing | MBS MacBase Plugin | 13.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
File: The file to open.
Returns an initialized NSImage instance, or nil if the method cannot create an image representation from the contents of the specified file.
NSImageMBS.imageWithContentsOfFileMT(file as folderitem) as NSImageMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa Drawing | MBS MacBase Plugin | 13.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
File: The file to open.
Returns an initialized NSImage instance, or nil if the method cannot create an image representation from the contents of the specified file.
The work is performed on a preemptive thread, so this function does not block the application and can yield time to other Xojo threads. Must be called in a Xojo thread to enjoy benefits. If called in main thread will block, but keep other background threads running.
If you run several threads calling MT methods, you can get all CPU cores busy while main thread shows GUI with progress window.
NSImageMBS.imageWithContentsOfPath(path as string) as NSImageMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa Drawing | MBS MacBase Plugin | 13.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
path: A full or relative path name specifying the file with the desired image data. Relative paths must be relative to the current working directory.
Returns an initialized NSImage instance, or nil if the method cannot create an image representation from the contents of the specified file.
The filename parameter should include the file extension that identifies the type of the image data. This method looks for an NSImageRep subclass that handles that data type from among those registered with NSImage.
NSImageMBS.imageWithContentsOfPathMT(path as string) as NSImageMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa Drawing | MBS MacBase Plugin | 13.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
path: A full or relative path name specifying the file with the desired image data. Relative paths must be relative to the current working directory.
Returns an initialized NSImage instance, or nil if the method cannot create an image representation from the contents of the specified file.
The filename parameter should include the file extension that identifies the type of the image data. This method looks for an NSImageRep subclass that handles that data type from among those registered with NSImage.
The work is performed on a preemptive thread, so this function does not block the application and can yield time to other Xojo threads. Must be called in a Xojo thread to enjoy benefits. If called in main thread will block, but keep other background threads running.
If you run several threads calling MT methods, you can get all CPU cores busy while main thread shows GUI with progress window.
NSImageMBS.imageWithContentsOfURL(URL as string) as NSImageMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa Drawing | MBS MacBase Plugin | 13.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Returns an initialized NSImage instance, or nil if the method cannot create an image representation from the contents of the specified URL.
NSImageMBS.imageWithContentsOfURLMT(URL as string) as NSImageMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa Drawing | MBS MacBase Plugin | 13.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Returns an initialized NSImage instance, or nil if the method cannot create an image representation from the contents of the specified URL.
The work is performed on a preemptive thread, so this function does not block the application and can yield time to other Xojo threads. Must be called in a Xojo thread to enjoy benefits. If called in main thread will block, but keep other background threads running.
NSImageMBS.imageWithData(data as memoryblock) as NSImageMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa Drawing | MBS MacBase Plugin | 13.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Returns an initialized NSImage instance, or nil if the method cannot create an image representation from the contents of the specified data object.
See also:
NSImageMBS.imageWithData(data as string) as NSImageMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa Drawing | MBS MacBase Plugin | 13.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Returns an initialized NSImage instance, or nil if the method cannot create an image representation from the contents of the specified data object.
See also:
NSImageMBS.imageWithDataMT(data as memoryblock) as NSImageMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa Drawing | MBS MacBase Plugin | 13.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Returns an initialized NSImage instance, or nil if the method cannot create an image representation from the contents of the specified data object.
The work is performed on a preemptive thread, so this function does not block the application and can yield time to other Xojo threads. Must be called in a Xojo thread to enjoy benefits. If called in main thread will block, but keep other background threads running.
If you run several threads calling MT methods, you can get all CPU cores busy while main thread shows GUI with progress window.
See also:
NSImageMBS.imageWithDataMT(data as string) as NSImageMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa Drawing | MBS MacBase Plugin | 13.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Returns an initialized NSImage instance, or nil if the method cannot create an image representation from the contents of the specified data object.
The work is performed on a preemptive thread, so this function does not block the application and can yield time to other Xojo threads. Must be called in a Xojo thread to enjoy benefits. If called in main thread will block, but keep other background threads running.
If you run several threads calling MT methods, you can get all CPU cores busy while main thread shows GUI with progress window.
See also:
NSImageMBS.imageWithHandle(Handle as Integer) as NSImageMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa Drawing | MBS MacBase Plugin | 14.4 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
NSImageMBS.imageWithSystemSymbolName(name as string, accessibilityDescription as string = "") as NSImageMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa Drawing | MBS MacBase Plugin | 20.5 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
For macOS 11.0 or newer.
See list of symbols in SF Symbol font, see SF Symbols app or the list here:
https://developer.apple.com/design/human-interface-guidelines/sf-symbols/overview/
NSImageMBS.NSImageHintUserInterfaceLayoutDirection as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa Drawing | MBS MacBase Plugin | 16.5 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
value is a number with NSUserInterfaceLayoutDirection enum value
NSImageMBS.NSImageNameActionTemplate as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa Drawing | MBS MacBase Plugin | 12.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
To access this image, pass the specified constant to the imageNamed method.
An action menu template image.
Available in Mac OS X v10.5 and later.
NSImageMBS.NSImageNameAddTemplate as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa Drawing | MBS MacBase Plugin | 12.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
An add item template image.
Available in Mac OS X v10.5 and later.
To access this image, pass the specified constant to the imageNamed method.
NSImageMBS.NSImageNameAdvanced as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa Drawing | MBS MacBase Plugin | 12.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
To access this image, pass the specified constant to the imageNamed method.
Advanced preferences toolbar icon. Use in a preferences window only.
Available in Mac OS X v10.5 and later.
NSImageMBS.NSImageNameApplicationIcon as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa Drawing | MBS MacBase Plugin | 12.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
To access this image, pass the specified constant to the imageNamed method.
The application's icon.
On versions of Mac OS X prior to v10.6, you can use the string "NSApplicationIcon".
Available in Mac OS X v10.6 and later.
NSImageMBS.NSImageNameBluetoothTemplate as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa Drawing | MBS MacBase Plugin | 12.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
To access this image, pass the specified constant to the imageNamed method.
A Bluetooth template image.
Available in Mac OS X v10.5 and later.
NSImageMBS.NSImageNameBonjour as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa Drawing | MBS MacBase Plugin | 12.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
To access this image, pass the specified constant to the imageNamed method.
A Bonjour icon.
Available in Mac OS X v10.5 and later.
NSImageMBS.NSImageNameBookmarksTemplate as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa Drawing | MBS MacBase Plugin | 12.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
To access this image, pass the specified constant to the imageNamed method.
Bookmarks image suitable for a template.
Available in Mac OS X v10.6 and later.
NSImageMBS.NSImageNameCaution as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa Drawing | MBS MacBase Plugin | 12.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
To access this image, pass the specified constant to the imageNamed method.
Caution Image.
Available in Mac OS X v10.6 and later.
NSImageMBS.NSImageNameColorPanel as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa Drawing | MBS MacBase Plugin | 12.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
To access this image, pass the specified constant to the imageNamed method.
A color panel toolbar icon.
Available in Mac OS X v10.5 and later.
NSImageMBS.NSImageNameColumnViewTemplate as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa Drawing | MBS MacBase Plugin | 12.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
To access this image, pass the specified constant to the imageNamed method.
A column view mode template image.
Available in Mac OS X v10.5 and later.
NSImageMBS.NSImageNameComputer as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa Drawing | MBS MacBase Plugin | 12.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
To access this image, pass the specified constant to the imageNamed method.
A computer icon.
Available in Mac OS X v10.5 and later.
NSImageMBS.NSImageNameDotMac as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa Drawing | MBS MacBase Plugin | 12.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
To access this image, pass the specified constant to the imageNamed method.
A Dot Mac icon.
Available in Mac OS X v10.5 and later.
NSImageMBS.NSImageNameEnterFullScreenTemplate as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa Drawing | MBS MacBase Plugin | 12.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
An enter full-screen mode template image.
Available in Mac OS X v10.5 and later.
To access this image, pass the specified constant to the imageNamed method.
NSImageMBS.NSImageNameEveryone as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa Drawing | MBS MacBase Plugin | 12.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
To access this image, pass the specified constant to the imageNamed method.
Permissions for all users.
Available in Mac OS X v10.5 and later.
NSImageMBS.NSImageNameExitFullScreenTemplate as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa Drawing | MBS MacBase Plugin | 12.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
An exit full-screen mode template image.
Available in Mac OS X v10.5 and later.
To access this image, pass the specified constant to the imageNamed method.
NSImageMBS.NSImageNameFlowViewTemplate as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa Drawing | MBS MacBase Plugin | 12.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
To access this image, pass the specified constant to the imageNamed method.
A cover flow view mode template image.
Available in Mac OS X v10.5 and later.
NSImageMBS.NSImageNameFolder as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa Drawing | MBS MacBase Plugin | 12.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
To access this image, pass the specified constant to the imageNamed method.
A folder image.
Available in Mac OS X v10.6 and later.
NSImageMBS.NSImageNameFolderBurnable as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa Drawing | MBS MacBase Plugin | 12.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
To access this image, pass the specified constant to the imageNamed method.
A burnable folder icon.
Available in Mac OS X v10.5 and later.
NSImageMBS.NSImageNameFolderSmart as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa Drawing | MBS MacBase Plugin | 12.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
A smart folder icon.
Available in Mac OS X v10.5 and later.
To access this image, pass the specified constant to the imageNamed method.
The items on this page are in the following plugins: MBS MacBase Plugin.
