Platforms to show: All Mac Windows Linux Cross-Platform
Back to NSImageMBS class.
NSImageMBS.cancelIncrementalLoad
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Cocoa Drawing | MBS MacBase Plugin | 9.6 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
This call has no effect if the image is not loading.
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Cocoa Drawing | MBS MacBase Plugin | 7.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
See also:
NSImageMBS.Constructor(data as Memoryblock)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Cocoa Drawing | MBS MacBase Plugin | 7.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Calls initWithData.
On success the image is valid and the handle is not zero.
See also:
NSImageMBS.Constructor(file as folderitem)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Cocoa Drawing | MBS MacBase Plugin | 7.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Calls initWithContentsOfURL.
On success the image is valid and the handle is not zero.
See also:
NSImageMBS.Constructor(image as Picture, mask as picture = nil)
| 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.
Calls initWithPicture.
See also:
NSImageMBS.Constructor(width as Double, height as Double)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Cocoa Drawing | MBS MacBase Plugin | 7.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Calls initWithSize.
On success the image is valid and the handle is not zero.
See also:
NSImageMBS.CopyMask as picture
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Cocoa Drawing | MBS MacBase Plugin | 7.5 | ✅ Yes | ❌ No | ❌ No | ❌ No | All |
Copies only the alpha channel as mask.
Returns nil on any error.
Not implemented for iOS.
NSImageMBS.CopyPicture(CGColorSpace as Variant = nil, BackgroundColor as NSColorMBS = nil) as picture
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Cocoa Drawing | MBS MacBase Plugin | 7.5 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
A convenience function instead of using CGPictureContextMBS with DrawIntoCGContextAtRect.
Returns nil on any error.
With Colorspace parameter you can pass a RGB CGColorspace to define which colorspace is used. Default is DeviceRGB, but you could also pass generic RGB or other.
If BackgroundColor is not nil, the image is filled in background with this color and NSImage rendered on top of it.
Implemented for iOS in v22.4 to return underlaying UIImage as Xojo picture. Colorspace and background are ignored as picture is passed directly.
NSImageMBS.CopyPictureRect(x as Integer, y as Integer, w as Integer, h as Integer, CGColorSpace as Variant = nil, BackgroundColor as NSColorMBS = nil) as picture
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Cocoa Drawing | MBS MacBase Plugin | 13.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | All |
A convenience function instead of using CGPictureContextMBS with DrawIntoCGContextAtRect.
Returns nil on any error.
With Colorspace parameter you can pass a RGB CGColorspace to define which colorspace is used. Default is DeviceRGB, but you could also pass generic RGB or other.
If BackgroundColor is not nil, the image is filled in background with this color and NSImage rendered on top of it.
Not implemented for iOS.
NSImageMBS.CopyPictureWithAlpha as picture
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Cocoa Drawing | MBS MacBase Plugin | 15.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | All |
This is a function for Cocoa target which returns picture with alpha channel.
Returns nil on any error.
Not implemented for iOS.
NSImageMBS.CopyPictureWithAlphaRect(x as Integer, y as Integer, w as Integer, h as Integer) as picture
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Cocoa Drawing | MBS MacBase Plugin | 15.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | All |
This is a function for Cocoa target which returns picture with alpha channel.
Returns nil on any error.
Not implemented for iOS.
NSImageMBS.CopyPictureWithMask(CGColorSpace as Variant = nil) as picture
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Cocoa Drawing | MBS MacBase Plugin | 7.5 | ✅ Yes | ❌ No | ❌ No | ❌ No | All |
Copies the picture and its mask.
This function is faster than CopyPicture and CopyMask combined as the picture is only copied one time to an internal buffer.
A convenience function instead of using CGPictureContextMBS with DrawIntoCGContextAtRect.
Returns nil on any error.
With Colorspace parameter you can pass a RGB CGColorspace to define which colorspace is used. Default is DeviceRGB, but you could also pass generic RGB or other.
Not implemented for iOS.
The items on this page are in the following plugins: MBS MacBase Plugin.