UIKit.UIImage Class
Image representation in UIKit, with support for loading, saving and manipulating images.

See Also: UIImage Members


[Foundation.Register("UIImage", true)]
public class UIImage : Foundation.NSObject, Foundation.INSSecureCoding, IUIAccessibilityIdentification, IDisposable


Image objects do not provide direct access to the underlying image - they are immutable. The methods UIImage.AsJPEG() or UIImage.AsPNG() will provide the underlying image data as a JPEG or PNG.

To avoid issues with excessive memory use, UIImages objects should not be larger than 1024x1024 in size. Code-based manipulations such as resizing are not subject to this restriction.

It is possible that the system may purge UIImage objects to free up memory. If the UIImage is required later on by an application, it will be loaded again from its source file.

The following image formats are supported by the UIImage class:

Starting with iOS 8, the UIKIt.UIImage.FromBundle(string, Foundation.NSBundle, UIKIt.UITraitCollection) method can be used to load a UIImage that takes into consideration a UIKit.UITraitCollection. This can automatically load the proper image for the specified resolution.

Most of the members of this class can be used from a background thread, with a couple of exceptions (FromBundle methods that retrieve images from the bundle and use the built-in memory cache).

Related content


Namespace: UIKit
Assembly: Xamarin.iOS (in Xamarin.iOS.dll)
Assembly Versions: