Platforms to show: All Mac Windows Linux Cross-Platform
Back to CGImageMBS class.
CGImageMBS.CreateImage(pic as picture) as CGImageMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | CoreGraphics | MBS MacCG Plugin | 13.5 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
If the image has a mask, it is used.
See also:
CGImageMBS.CreateImage(pic as picture, mask as picture) as CGImageMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | CoreGraphics | MBS MacCG Plugin | 13.5 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
The mask is taken from the second image.
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.
See also:
CGImageMBS.CreateImageFromJPEGDataProvider(dataprovider as Variant, decode as memoryblock, shouldInterpolate as boolean, intent as Integer) as CGImageMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | CoreGraphics | MBS MacCG Plugin | 13.5 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Parameters:
dataprovider:
A reference to a data provider supplying JPEG-encoded data.
decode:
Pass the decode array for the image. In the decode array, for each color component in the source color space, you provide a pair of values denoting the upper and lower limits of a range. For example, the decode array for a source image in the RGB color space would contain six entries total, consisting of one pair each for red, green, and blue. When the image is rendered, Quartz uses a linear transform to map the original component value into a relative number within your designated range that is appropriate for the destination color space. If you do not want to allow remapping of the image's color values, pass nil for the decode array. The memoryblock for the array needs to be filled with double values.
shouldInterpolate:
Pass true if interpolation should occur; otherwise, pass false . The interpolation setting specifies whether Quartz should apply a pixel-smoothing algorithm to the image. If you pass false , the image may appear jagged or pixelated when drawn on an output device with higher resolution than the image data.
intent:
Pass a CGColorRenderingIntent value specifying how Quartz should display colors in the image that are not located within the current color space of the graphics context. The rendering intent determines the exact method used to map colors from one color space to another.
CGImageMBS.CreateImageFromPNGDataProvider(dataprovider as Variant, decode as memoryblock, shouldInterpolate as boolean, intent as Integer) as CGImageMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | CoreGraphics | MBS MacCG Plugin | 13.5 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Parameters:
dataprovider:
A reference to a data provider supplying JPEG-encoded data.
decode:
Pass the decode array for the image. In the decode array, for each color component in the source color space, you provide a pair of values denoting the upper and lower limits of a range. For example, the decode array for a source image in the RGB color space would contain six entries total, consisting of one pair each for red, green, and blue. When the image is rendered, Quartz uses a linear transform to map the original component value into a relative number within your designated range that is appropriate for the destination color space. If you do not want to allow remapping of the image's color values, pass nil for the decode array. The memoryblock for the array needs to be filled with double values.
shouldInterpolate:
Pass true if interpolation should occur; otherwise, pass false . The interpolation setting specifies whether Quartz should apply a pixel-smoothing algorithm to the image. If you pass false , the image may appear jagged or pixelated when drawn on an output device with higher resolution than the image data.
intent:
Pass a CGColorRenderingIntent value specifying how Quartz should display colors in the image that are not located within the current color space of the graphics context. The rendering intent determines the exact method used to map colors from one color space to another.
CGImageMBS.CreateImageWithFile(file as folderitem) as CGImageMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | CoreGraphics | MBS MacCG Plugin | 15.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Returns nil on any error.
Some examples using this method:
CGImageMBS.CreateImageWithHandle(handle as Integer) as CGImageMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | CoreGraphics | MBS MacCG Plugin | 13.5 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Internally the CGImageMBS retains this reference and releases it in destructor.
The items on this page are in the following plugins: MBS MacCG Plugin.