Platforms to show: All Mac Windows Linux Cross-Platform

Back to CIImageMBS class.

CIImageMBS.emptyImage as CIImageMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method CoreImage MBS MacCI Plugin 13.0 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates and returns an empty image object.
Example
Var image as CIImageMBS = CIImageMBS.emptyImage
MsgBox str(image.Width) // shows zero

Available in OS X v10.5 and later.

CIImageMBS.imageWithCGImage(CGImage as CGImageMBS, colorspace as CGColorSpaceMBS) as CIImageMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method CoreImage MBS MacCI Plugin 13.0 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates and returns an image object from a Quartz 2D image using the specified color space.

Returns nil on any error.

See also:

CIImageMBS.imageWithCGImage(CGImage as CGImageMBS, options as Dictionary = nil) as CIImageMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method CoreImage MBS MacCI Plugin 13.0 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates and returns an image object from a Quartz 2D image.

Returns nil on any error.

See also:

CIImageMBS.imageWithCGLayer(CGImage as CGImageMBS, options as Dictionary = nil) as CIImageMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method CoreImage MBS MacCI Plugin 14.1 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Creates and returns an image object from the contents supplied by a CGLayer object, using the specified options.

layer: A CGLayer object. For more information see Quartz 2D Programming Guide and CGLayer Reference.
options: A dictionary specifying image options.

An image object initialized with the contents of the layer object and set up with the specified options.

CIImageMBS.imageWithColor(color as CIColorMBS) as CIImageMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method CoreImage MBS MacCI Plugin 13.0 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates and returns an image of infinite extent that is initialized the specified color.

Returns the image object initialized with the color represented by the CIColorMBS object.
Available in OS X v10.5 and later.

CIImageMBS.imageWithContentsOfFile(file as folderitem) as CIImageMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method CoreImage MBS MacCI Plugin 13.0 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates and returns an image object from the contents of a file.
Example
Var file as FolderItem = SpecialFolder.Desktop.Child("mbs.jpg")
Var image as CIImageMBS = CIImageMBS.imageWithContentsOfFile(file)
Backdrop = image.RenderPicture

Returns nil on any error.

See also:

CIImageMBS.imageWithContentsOfFile(file as folderitem, colorspace as CGColorSpaceMBS) as CIImageMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method CoreImage MBS MacCI Plugin 13.0 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates and returns an image object from the contents of a file.

Returns nil on any error.

See also:

CIImageMBS.imageWithContentsOfFileMT(file as folderitem) as CIImageMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method CoreImage MBS MacCI Plugin 13.0 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates and returns an image object from the contents of a file.
Example
Var file as FolderItem = SpecialFolder.Desktop.Child("mbs.jpg")
Var image as CIImageMBS = CIImageMBS.imageWithContentsOfFileMT(file)
Backdrop = image.RenderPicture

Returns nil on any error.

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:

CIImageMBS.imageWithContentsOfFileMT(file as folderitem, colorspace as CGColorSpaceMBS) as CIImageMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method CoreImage MBS MacCI Plugin 13.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates and returns an image object from the contents of a file.
Example
Var file as FolderItem = SpecialFolder.Desktop.Child("mbs.jpg")
Var cs as CGColorSpaceMBS = CGColorSpaceMBS.CreateDeviceRGB
Var image as CIImageMBS = CIImageMBS.imageWithContentsOfFileMT(file, cs)
Backdrop = image.RenderPicture

Returns nil on any error.

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:

CIImageMBS.imageWithContentsOfPath(Path as string, colorspace as CGColorSpaceMBS) as CIImageMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method CoreImage MBS MacCI Plugin 13.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates and returns an image object from the contents of a file.
Example
// load image
Var inputimage as CIImageMBS = CIImageMBS.imageWithContentsOfPath("/Library/Desktop Pictures/Rice Paddy.jpg", nil)

// rotate 90°
Var ScaleXFilter as new CIFilterAffineTransformMBS
ScaleXFilter.inputImage = inputimage
Var af as new NSAffineTransformMBS
af.translate(inputimage.height,0)
af.rotateByDegrees(90)
ScaleXFilter.inputTransform=af

// produce output
Var outputimage as CIImageMBS = ScaleXFilter.outputImage
Var e as CGRectMBS = outputimage.Extent
Backdrop = outputimage.RenderPicture
Title = Str(Backdrop.Width)+" x "+str(Backdrop.Height)

// write to PNG file
Var n as NSImageMBS = outputimage.AsNSImageMBS
Var data as string = n.PNGRepresentation

Var f as FolderItem = SpecialFolder.Desktop.Child("test.png")
Var b as BinaryStream = BinaryStream.Create(f, true)
b.Write data
b.Close

Returns nil on any error.

CIImageMBS.imageWithContentsOfURL(url as String) as CIImageMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method CoreImage MBS MacCI Plugin 13.0 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates and returns an image object from the contents of a file.

Returns nil on any error.

See also:

CIImageMBS.imageWithContentsOfURL(URL as string, colorspace as CGColorSpaceMBS) as CIImageMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method CoreImage MBS MacCI Plugin 13.0 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates and returns an image object from the contents of a file.

Returns nil on any error.

See also:

CIImageMBS.imageWithData(data as memoryblock, Options as Dictionary = nil) as CIImageMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method CoreImage MBS MacCI Plugin 13.0 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates and returns an image object initialized with the supplied image data.
Example
Var logo as Picture = LogoMBS(500)
Var jpegData as string = PictureToJPEGStringMBS(logo, 75)
Var image as CIImageMBS = CIImageMBS.imageWithData(jpegData)
Backdrop = image.RenderPicture

data: The data object that holds the contents of an image file (such as TIFF, GIF, JPG, or whatever else the system supports). The image data must be premultiplied.

Returns an image object initialized with the supplied data, or nil if the method cannot create an image representation from the contents of the supplied data object.

CIImageMBS.imageWithDataMT(data as memoryblock, Options as Dictionary = nil) as CIImageMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method CoreImage MBS MacCI Plugin 13.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates and returns an image object initialized with the supplied image data.
Example
Var logo as Picture = LogoMBS(500)
Var jpegData as string = PictureToJPEGStringMBS(logo, 75)
Var image as CIImageMBS = CIImageMBS.imageWithDataMT(jpegData)
Backdrop = image.RenderPicture

data: The data object that holds the contents of an image file (such as TIFF, GIF, JPG, or whatever else the system supports). The image data must be premultiplied.

Returns an image object initialized with the supplied data, or nil if the method cannot create an image representation from the contents of the supplied 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.

CIImageMBS.imageWithPicture(Pic as Picture) as CIImageMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method CoreImage MBS MacCI Plugin 13.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates and returns an image object from a Xojo Picture.
Example
Var logo as Picture = LogoMBS(500)
Var ci as CIImageMBS = CIImageMBS.imageWithPicture(logo)
Var cg as CGImageMBS = ci.CreateCGImage
Backdrop = cg.Picture

Returns nil on any error.

The items on this page are in the following plugins: MBS MacCI Plugin.


The biggest plugin in space...