Xojo Conferences
MBSSep2018MunichDE
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

Next items

NSImageMBS.canInitWithPasteboard as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa Drawing MBS MacBase Plugin 9.6 Yes No No Yes, macOS only No
Function: Tests whether the receiver can create an instance of itself using pasteboard data.
Notes: 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.

Feedback, Comments & Corrections

NSImageMBS.imageFileTypes as string()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa Drawing MBS MacBase Plugin 12.2 Yes No No Yes, macOS only No
Function: Returns an array of strings identifying the image types supported by the registered NSImageRep objects.
Example:
dim types() as string = NSImageMBS.imageFileTypes
MsgBox Join(types, EndOfLine)
Notes:
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.

Feedback, Comments & Corrections

NSImageMBS.imageNamed(name as string) as NSImageMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa Drawing MBS MacBase Plugin 8.4 Yes No No Yes, macOS only No
Function: Returns the NSImage instance associated with the specified name.
Notes:
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/

Feedback, Comments & Corrections

NSImageMBS.imagePasteboardTypes as string()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa Drawing MBS MacBase Plugin 12.2 Yes No No Yes, macOS only No
Function: Returns an array of strings identifying the pasteboard types supported directly by the registered NSImageRep objects.
Example:
dim types() as string = NSImageMBS.imagePasteboardTypes
MsgBox Join(types, EndOfLine)
Notes:
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.

Feedback, Comments & Corrections

NSImageMBS.imageTypes as string()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa Drawing MBS MacBase Plugin 12.2 Yes No No Yes, macOS only No
Function: Returns an array of UTI strings identifying the image types supported by the registered NSImageRep objects, either directly or through a user-installed filter service.
Example:
dim types() as string = NSImageMBS.imageTypes
MsgBox Join(types, EndOfLine)
Notes:
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.

Feedback, Comments & Corrections

NSImageMBS.imageUnfilteredFileTypes as string()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa Drawing MBS MacBase Plugin 12.2 Yes No No Yes, macOS only No
Function: Returns an array of strings identifying the file types supported directly by the registered NSImageRep objects.
Example:
dim types() as string = NSImageMBS.imageUnfilteredFileTypes
MsgBox Join(types, EndOfLine)
Notes:
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.

Feedback, Comments & Corrections

NSImageMBS.imageUnfilteredPasteboardTypes as string()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa Drawing MBS MacBase Plugin 12.2 Yes No No Yes, macOS only No
Function: Returns an array of strings identifying the pasteboard types supported directly by the registered NSImageRep objects.
Example:
dim types() as string = NSImageMBS.imageUnfilteredPasteboardTypes
MsgBox Join(types, EndOfLine)
Notes:
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.

Feedback, Comments & Corrections

NSImageMBS.imageUnfilteredTypes as string()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa Drawing MBS MacBase Plugin 12.2 Yes No No Yes, macOS only No
Function: Returns an array of UTI strings identifying the image types supported directly by the registered NSImageRep objects.
Example:
dim types() as string = NSImageMBS.imageUnfilteredTypes
MsgBox Join(types, EndOfLine)
Notes:
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.

Feedback, Comments & Corrections

NSImageMBS.imageWithCGImage(CGImage as Variant, width as Double = 0, height as Double = 0) as NSImageMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa Drawing MBS MacBase Plugin 13.1 Yes No No Yes, macOS only No
Function: Initializes and returns an NSImage instance with the contents of the CGImage.
Example:
dim logo as Picture = LogoMBS(500)
dim cgimage as CGImageMBS = CGCreateImageMBS(logo)
dim nsimage as NSImageMBS = NSImageMBS.imageWithCGImage(cgimage)
dim pic as Picture = nsimage.CopyPictureWithMask
Backdrop = pic
Notes:
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.

Feedback, Comments & Corrections

NSImageMBS.imageWithContentsOfFile(file as folderitem) as NSImageMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa Drawing MBS MacBase Plugin 13.1 Yes No No Yes, macOS only No
Function: Initializes and returns an NSImage instance with the contents of the specified file.
Example:
dim file as FolderItem = SpecialFolder.Desktop.Child("mbs.jpg")
dim image as NSImageMBS = NSImageMBS.imageWithContentsOfFile(file)
Backdrop = image.CopyPictureWithMask
Notes:
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.

Feedback, Comments & Corrections

NSImageMBS.imageWithContentsOfFileMT(file as folderitem) as NSImageMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa Drawing MBS MacBase Plugin 13.1 Yes No No Yes, macOS only No
Function: Initializes and returns an NSImage instance with the contents of the specified file.
Example:
dim file as FolderItem = SpecialFolder.Desktop.Child("mbs.jpg")
dim image as NSImageMBS = NSImageMBS.imageWithContentsOfFileMT(file)
Backdrop = image.CopyPictureWithMask
Notes:
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.

Must be called inside a Xojo (Real Studio) thread so time yields to main thread and you can keep the GUI running.

Feedback, Comments & Corrections

NSImageMBS.imageWithContentsOfPath(path as string) as NSImageMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa Drawing MBS MacBase Plugin 13.1 Yes No No Yes, macOS only No
Function: Initializes and returns an NSImage instance with the contents of the specified file.
Example:
dim file as FolderItem = SpecialFolder.Desktop.Child("mbs.jpg")
dim path as string = file.UnixpathMBS
dim image as NSImageMBS = NSImageMBS.imageWithContentsOfPath(path)
Backdrop = image.CopyPictureWithMask
Notes:
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.

Feedback, Comments & Corrections

NSImageMBS.imageWithContentsOfPathMT(path as string) as NSImageMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa Drawing MBS MacBase Plugin 13.1 Yes No No Yes, macOS only No
Function: Initializes and returns an NSImage instance with the contents of the specified file.
Example:
dim file as FolderItem = SpecialFolder.Desktop.Child("mbs.jpg")
dim path as string = file.UnixpathMBS
dim image as NSImageMBS = NSImageMBS.imageWithContentsOfPathMT(path)
Backdrop = image.CopyPictureWithMask
Notes:
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.

Must be called inside a Xojo (Real Studio) thread so time yields to main thread and you can keep the GUI running.

Feedback, Comments & Corrections

NSImageMBS.imageWithContentsOfURL(URL as string) as NSImageMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa Drawing MBS MacBase Plugin 13.1 Yes No No Yes, macOS only No
Function: Initializes and returns an NSImage instance with the contents of the specified URL.
Example:
dim url as string = "http://www.monkeybreadsoftware.de/images/MBSLogo.jpg"
dim img as NSImageMBS = NSImageMBS.imageWithContentsOfURL(url)
Backdrop = img.CopyPictureWithMask
Notes: Returns an initialized NSImage instance, or nil if the method cannot create an image representation from the contents of the specified URL.

Feedback, Comments & Corrections

NSImageMBS.imageWithContentsOfURLMT(URL as string) as NSImageMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa Drawing MBS MacBase Plugin 13.1 Yes No No Yes, macOS only No
Function: Initializes and returns an NSImage instance with the contents of the specified URL.
Example:
dim url as string = "http://www.monkeybreadsoftware.de/images/MBSLogo.jpg"
dim img as NSImageMBS = NSImageMBS.imageWithContentsOfURLMT(url)
Backdrop = img.CopyPictureWithMask
Notes:
Returns an initialized NSImage instance, or nil if the method cannot create an image representation from the contents of the specified URL.
Must be called inside a Xojo (Real Studio) thread so time yields to main thread and you can keep the GUI running.

Feedback, Comments & Corrections

NSImageMBS.imageWithData(data as memoryblock) as NSImageMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa Drawing MBS MacBase Plugin 13.1 Yes No No Yes, macOS only No
Function: Initializes and returns an NSImage instance with the contents of the specified memoryblock.
Example:
dim logo as Picture = LogoMBS(500)
dim jpeg as string = PictureToJPEGStringMBS(logo, 75)
dim nsimage as NSImageMBS = NSImageMBS.imageWithData(jpeg)
dim pic as Picture = nsimage.CopyPictureWithMask
Backdrop = pic
Notes: 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:

Feedback, Comments & Corrections

NSImageMBS.imageWithData(data as string) as NSImageMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa Drawing MBS MacBase Plugin 13.1 Yes No No Yes, macOS only No
Function: Initializes and returns an NSImage instance with the contents of the specified string.
Example:
dim logo as Picture = LogoMBS(500)
dim jpeg as string = PictureToJPEGStringMBS(logo, 75)
dim nsimage as NSImageMBS = NSImageMBS.imageWithData(jpeg)
dim pic as Picture = nsimage.CopyPictureWithMask
Backdrop = pic
Notes: 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:

Feedback, Comments & Corrections

NSImageMBS.imageWithDataMT(data as memoryblock) as NSImageMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa Drawing MBS MacBase Plugin 13.1 Yes No No Yes, macOS only No
Function: Initializes and returns an NSImage instance with the contents of the specified memoryblock.
Example:
dim logo as Picture = LogoMBS(500)
dim jpeg as string = PictureToJPEGStringMBS(logo, 75)
dim nsimage as NSImageMBS = NSImageMBS.imageWithDataMT(jpeg)
dim pic as Picture = nsimage.CopyPictureWithMask
Backdrop = pic
Notes:
Returns an initialized NSImage instance, or nil if the method cannot create an image representation from the contents of the specified data object.
Must be called inside a Xojo (Real Studio) thread so time yields to main thread and you can keep the GUI running.

See also:

Feedback, Comments & Corrections

NSImageMBS.imageWithDataMT(data as string) as NSImageMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa Drawing MBS MacBase Plugin 13.1 Yes No No Yes, macOS only No
Function: Initializes and returns an NSImage instance with the contents of the specified string.
Example:
dim logo as Picture = LogoMBS(500)
dim jpeg as string = PictureToJPEGStringMBS(logo, 75)
dim nsimage as NSImageMBS = NSImageMBS.imageWithDataMT(jpeg)
dim pic as Picture = nsimage.CopyPictureWithMask
Backdrop = pic
Notes:
Returns an initialized NSImage instance, or nil if the method cannot create an image representation from the contents of the specified data object.
Must be called inside a Xojo (Real Studio) thread so time yields to main thread and you can keep the GUI running.

See also:

Feedback, Comments & Corrections

NSImageMBS.imageWithHandle(Handle as Integer) as NSImageMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa Drawing MBS MacBase Plugin 14.4 Yes No No Yes, macOS only No
Function: Creates a new picture for a NSImage handle.

Feedback, Comments & Corrections

NSImageMBS.NSImageHintUserInterfaceLayoutDirection as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa Drawing MBS MacBase Plugin 16.5 Yes No No Yes, macOS only No
Function: One of the dictionary keys used in the hints dictionary.
Notes: value is a number with NSUserInterfaceLayoutDirection enum value

Feedback, Comments & Corrections

NSImageMBS.NSImageNameActionTemplate as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa Drawing MBS MacBase Plugin 12.2 Yes No No Yes, macOS only No
Function: One of the images representing standard artwork and icons that you can use in your applications.
Notes:
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.

Feedback, Comments & Corrections

NSImageMBS.NSImageNameAddTemplate as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa Drawing MBS MacBase Plugin 12.2 Yes No No Yes, macOS only No
Function: One of the images representing standard artwork and icons that you can use in your applications.
Notes:
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.

Feedback, Comments & Corrections

NSImageMBS.NSImageNameAdvanced as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa Drawing MBS MacBase Plugin 12.2 Yes No No Yes, macOS only No
Function: One of the images that you can use in application toolbars.
Notes:
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.

Feedback, Comments & Corrections

NSImageMBS.NSImageNameApplicationIcon as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa Drawing MBS MacBase Plugin 12.2 Yes No No Yes, macOS only No
Function: One of the images that you can use in application toolbars.
Notes:
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.

Feedback, Comments & Corrections

NSImageMBS.NSImageNameBluetoothTemplate as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa Drawing MBS MacBase Plugin 12.2 Yes No No Yes, macOS only No
Function: One of the images representing standard artwork and icons that you can use in your applications.
Notes:
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.

Feedback, Comments & Corrections

NSImageMBS.NSImageNameBonjour as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa Drawing MBS MacBase Plugin 12.2 Yes No No Yes, macOS only No
Function: One of the images representing Finder items.
Notes:
To access this image, pass the specified constant to the imageNamed method.
A Bonjour icon.
Available in Mac OS X v10.5 and later.

Feedback, Comments & Corrections

NSImageMBS.NSImageNameBookmarksTemplate as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa Drawing MBS MacBase Plugin 12.2 Yes No No Yes, macOS only No
Function: One of the images that you can use in application toolbars.
Notes:
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.

Feedback, Comments & Corrections

NSImageMBS.NSImageNameCaution as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa Drawing MBS MacBase Plugin 12.2 Yes No No Yes, macOS only No
Function: One of the images that you can use in application toolbars.
Notes:
To access this image, pass the specified constant to the imageNamed method.
Caution Image.
Available in Mac OS X v10.6 and later.

Feedback, Comments & Corrections

Next items

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




Links
MBS Xojo Chart Plugins