Platforms to show: All Mac Windows Linux Cross-Platform
Back to NSImageMBS class.
NSImageMBS.imageByFadingToFraction(fraction as Double) as NSImageMBS
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Cocoa Drawing | MBS MacBase Plugin | 7.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Returns nil on failure.
NSImageMBS.imageByScalingToSize(width as Double, height as Double) as NSImageMBS
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Cocoa Drawing | MBS MacBase Plugin | 7.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Returns nil on failure.
Internally creates a copy of the image.
See also:
- imageByScalingToSize(width as Double, height as Double, fraction as Double) as NSImageMBS
- imageByScalingToSize(width as Double, height as Double, fraction as Double, flip as boolean, proportionally as boolean) as NSImageMBS
Some examples using this method:
NSImageMBS.imageByScalingToSize(width as Double, height as Double, fraction as Double) as NSImageMBS
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Cocoa Drawing | MBS MacBase Plugin | 7.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Returns nil on failure.
Internally creates a copy of the image.
See also:
NSImageMBS.imageByScalingToSize(width as Double, height as Double, fraction as Double, flip as boolean, proportionally as boolean) as NSImageMBS
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Cocoa Drawing | MBS MacBase Plugin | 7.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Returns nil on failure.
The image can be flipped vertically with the flip property.
Internally creates a copy of the image.
See also:
NSImageMBS.imageWithSymbolConfiguration(configuration as NSImageSymbolConfigurationMBS) as NSImageMBS
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Cocoa Drawing | MBS MacBase Plugin | 22.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
NSImageMBS.imageWithTintColor(tintColor as NSColorMBS) as NSImageMBS
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Cocoa Drawing | MBS MacBase Plugin | 20.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Input image should be grayscale.
NSImageMBS.initWithContentsOfURL(file as folderitem) as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Cocoa Drawing | MBS MacBase Plugin | 7.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Returns true on success and false on failure.
See also:
NSImageMBS.initWithContentsOfURL(url as string) as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Cocoa Drawing | MBS MacBase Plugin | 7.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Returns true on success and false on failure.
See also:
NSImageMBS.initWithData(data as Memoryblock) as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Cocoa Drawing | MBS MacBase Plugin | 7.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Returns true on success and false on failure.
NSImageMBS.initWithDataIgnoringOrientation(data as Memoryblock) as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Cocoa Drawing | MBS MacBase Plugin | 9.6 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
An initialized NSImage instance, or nil if the method cannot create an image representation from the contents of the specified data object.
Available in Mac OS X v10.6 and later.
NSImageMBS.initWithIconRef(IconHandle as Integer) as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Cocoa Drawing | MBS MacBase Plugin | 9.6 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
IconHandle: A reference to a Carbon icon resource (IconRef).
Creates one or more bitmap image representations, one for each size icon contained in the IconRef data structure. This initialization method automatically retains the data in the iconRef parameter and loads the bitmaps from that data file lazily.
Available in Mac OS X v10.5 and later.
NSImageMBS.initWithPasteboard as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Cocoa Drawing | MBS MacBase Plugin | 9.6 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
The specified pasteboard should contain a type supported by one of the registered NSImageRep subclasses. Table 1 lists the default pasteboard types and file extensions for several NSImageRep subclasses.
NSImageMBS.initWithPicture(img as picture, mask as picture = nil) as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Cocoa Drawing | MBS MacBase Plugin | 7.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Optional you can pass a picture with the mask. It is valid to use the mask property of the image for the second parameter.
With 11.3 plugins we are deprecating to pass a mask. The plugin prefers to simply take the mask or alpha channel of the picture itself.
On success the image is valid and the handle is not zero.
Some examples using this method:
NSImageMBS.initWithSize(width as Double, height as Double) as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Cocoa Drawing | MBS MacBase Plugin | 7.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Returns true on success and false on failure.
The items on this page are in the following plugins: MBS MacBase Plugin.