UIImage class

UIImage

Available extensions

Constructors

UIImage.castFrom(ObjCObjectBase other)
Constructs a UIImage that points to the same underlying object as other.
UIImage.castFromPointer(Pointer<ObjCObject> other, {bool retain = false, bool release = false})
Constructs a UIImage that wraps the given raw object pointer.

Properties

alignmentRectInsets int
alignmentRectInsets
no setter
baselineOffsetFromBottom double
The baseline offset is expressed in points from the bottom of the image (positive = up, negative = down). If the image doesn't have a defined baseline, this value will be 0, but you can use -hasBaseline to see if it actually has one defined (because it is perfectly possible to have a baseline with the value of 0).
no setter
capInsets int
default is UIEdgeInsetsZero for non resizable images
no setter
CGImage1 Pointer<CGImage>
returns underlying CGImageRef or nil if CIImage based
no setter
CIImage1 CIImage?
returns underlying CIImage or nil if CGImageRef based
no setter
configuration UIImageConfiguration?
Configuration support
no setter
debugDescription1 → NSString
debugDescription
no setterinherited
description1 → NSString
description
no setterinherited
duration double
total duration for all frames. default is 0 for non-animated images
no setter
flipsForRightToLeftLayoutDirection bool
flipsForRightToLeftLayoutDirection
no setter
hasBaseline bool
hasBaseline
no setter
hash1 int
hash
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
imageOrientation UIImageOrientation
this will affect how the image is composited
no setter
images → NSArray?
default is nil for non-animated images
no setter
isHighDynamicRange bool
Indicates that this image is tagged for display of high dynamic range content.
no setter
leftCapWidth int

Available on UIImage, provided by the UIImageDeprecated extension

default is 0. if non-zero, horiz. stretchable. right cap is calculated as width - leftCapWidth - 1
no setter
ref → _ObjCObjectRef
finalinherited
renderingMode UIImageRenderingMode
renderingMode
no setter
resizingMode UIImageResizingMode
default is UIImageResizingModeTile
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scale double
scale
no setter
size CGSize
reflects orientation setting. In iOS 4.0 and later, this is measured in points. In 3.x and earlier, measured in pixels
no setter
superclass1 → ObjCObjectBase
superclass
no setterinherited
symbolConfiguration UIImageSymbolConfiguration?
Symbol configuration support
no setter
symbolImage bool
isSymbolImage
no setter
topCapHeight int

Available on UIImage, provided by the UIImageDeprecated extension

default is 0. if non-zero, vert. stretchable. bottom cap is calculated as height - topCapWidth - 1
no setter
writableTypeIdentifiersForItemProvider1 → NSArray

Available on UIImage, provided by the NSItemProvider extension

writableTypeIdentifiersForItemProvider
no setter

Methods

autorelease() UIImage
autorelease
class2() → ObjCObjectBase
class
inherited
conformsToProtocol_1(Protocol aProtocol) bool
conformsToProtocol:
inherited
copy() → ObjCObjectBase
copy
inherited
dealloc() → void
dealloc
inherited
doesNotRecognizeSelector_(Pointer<ObjCSelector> aSelector) → void
doesNotRecognizeSelector:
inherited
drawAsPatternInRect_(CGRect rect) → void
draws the image as a CGPattern
drawAtPoint_(CGPoint point) → void
mode = kCGBlendModeNormal, alpha = 1.0
drawAtPoint_blendMode_alpha_(CGPoint point, CGBlendMode blendMode, double alpha) → void
drawAtPoint:blendMode:alpha:
drawInRect_(CGRect rect) → void
mode = kCGBlendModeNormal, alpha = 1.0
drawInRect_blendMode_alpha_(CGRect rect, CGBlendMode blendMode, double alpha) → void
drawInRect:blendMode:alpha:
encodeWithCoder_(NSCoder coder) → void
encodeWithCoder:
forwardingTargetForSelector_(Pointer<ObjCSelector> aSelector) → ObjCObjectBase
forwardingTargetForSelector:
inherited
forwardInvocation_(NSInvocation anInvocation) → void
forwardInvocation:
inherited
imageByApplyingSymbolConfiguration_(UIImageSymbolConfiguration configuration) UIImage?
This is a convenience method to apply another symbol configuration over an existing one. If the image doesn't have a symbol configuration, it will just merge the traits of the existing with the new one (where the new traits override the old traits).
imageFlippedForRightToLeftLayoutDirection() UIImage
Creates a version of this image that, when assigned to a UIImageView’s image property, draws its underlying image contents horizontally mirrored when running under a right-to-left language. Affects the flipsForRightToLeftLayoutDirection property; does not affect the imageOrientation property. This method cannot be used to create a left-to-right version of a right-to-left source image, and will be deprecated in a future release. New code should instead use -imageWithHorizontallyFlippedOrientation to construct a UIImageAsset.
imageRestrictedToStandardDynamicRange() UIImage
Returns a new image that will render within the standard range.
imageWithAlignmentRectInsets_(ObjCObjectBase alignmentInsets) UIImage
Support for constraint-based layout (auto layout) The alignmentRectInsets of a UIImage are used by UIImageView and other UIView and UIControl subclasses that take custom images to determine the view's alignment rect insets for constraint-based layout. The default alignmentRectInsets are UIEdgeInsetsZero.
imageWithBaselineOffsetFromBottom_(double baselineOffset) UIImage
imageWithBaselineOffsetFromBottom:
imageWithConfiguration_(UIImageConfiguration configuration) UIImage
Create a new image by replacing the existing configuration with a new one. For symbol images this will always result in an image with a UIImageSymbolConfiguration, even if you give it another type of configuration (the trait info from the new configuration will be merged into the current symbol configuration resulting in anew symbol configuration). For non-symbol images, this will replace the configuration of the image with a new one.
imageWithHorizontallyFlippedOrientation() UIImage
Creates a version of this image with an imageOrientation property that is horizontally mirrored from this image’s. Does not affect the flipsForRightToLeftLayoutDirection property.
imageWithoutBaseline() UIImage
imageWithoutBaseline
imageWithRenderingMode_(UIImageRenderingMode renderingMode) UIImage
Create a version of this image with the specified rendering mode. By default, images have a rendering mode of UIImageRenderingModeAutomatic.
imageWithTintColor_(ObjCObjectBase color) UIImage
imageWithTintColor:
imageWithTintColor_renderingMode_(ObjCObjectBase color, UIImageRenderingMode renderingMode) UIImage
imageWithTintColor:renderingMode:
init() UIImage
init
initWithCGImage_(Pointer<CGImage> cgImage) UIImage
initWithCGImage:
initWithCGImage_scale_orientation_(Pointer<CGImage> cgImage, double scale, UIImageOrientation orientation) UIImage
initWithCGImage:scale:orientation:
initWithCIImage_(CIImage ciImage) UIImage
initWithCIImage:
initWithCIImage_scale_orientation_(CIImage ciImage, double scale, UIImageOrientation orientation) UIImage
initWithCIImage:scale:orientation:
initWithCoder_(NSCoder coder) UIImage?
initWithCoder:
initWithContentsOfFile_(NSString path) UIImage?
initWithContentsOfFile:
initWithData_(NSData data) UIImage?
initWithData:
initWithData_scale_(NSData data, double scale) UIImage?
initWithData:scale:
isEqual_(ObjCObjectBase object) bool
isEqual:
inherited
isKindOfClass_(ObjCObjectBase aClass) bool
isKindOfClass:
inherited
isMemberOfClass_(ObjCObjectBase aClass) bool
isMemberOfClass:
inherited
isProxy() bool
isProxy
inherited
itemProviderVisibilityForRepresentationWithTypeIdentifier_1(NSString typeIdentifier) → NSItemProviderRepresentationVisibility

Available on UIImage, provided by the NSItemProvider extension

itemProviderVisibilityForRepresentationWithTypeIdentifier:
loadDataWithTypeIdentifier_forItemProviderCompletionHandler_(NSString typeIdentifier, ObjCBlock<Void Function(NSData?, NSError?)> completionHandler) NSProgress?

Available on UIImage, provided by the NSItemProvider extension

loadDataWithTypeIdentifier:forItemProviderCompletionHandler:
methodForSelector_(Pointer<ObjCSelector> aSelector) Pointer<NativeFunction<Void Function()>>
methodForSelector:
inherited
methodSignatureForSelector_(Pointer<ObjCSelector> aSelector) → NSMethodSignature
methodSignatureForSelector:
inherited
mutableCopy() → ObjCObjectBase
mutableCopy
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
performSelector_(Pointer<ObjCSelector> aSelector) → ObjCObjectBase
performSelector:
inherited
performSelector_withObject_(Pointer<ObjCSelector> aSelector, ObjCObjectBase object) → ObjCObjectBase
performSelector:withObject:
inherited
performSelector_withObject_withObject_(Pointer<ObjCSelector> aSelector, ObjCObjectBase object1, ObjCObjectBase object2) → ObjCObjectBase
performSelector:withObject:withObject:
inherited
release() → void
release
inherited
resizableImageWithCapInsets_(ObjCObjectBase capInsets) UIImage
create a resizable version of this image. the interior is tiled when drawn.
resizableImageWithCapInsets_resizingMode_(ObjCObjectBase capInsets, UIImageResizingMode resizingMode) UIImage
the interior is resized according to the resizingMode
respondsToSelector_(Pointer<ObjCSelector> aSelector) bool
respondsToSelector:
inherited
retain() UIImage
retain
retainCount() int
retainCount
inherited
self() UIImage
self
stretchableImageWithLeftCapWidth_topCapHeight_(int leftCapWidth, int topCapHeight) UIImage

Available on UIImage, provided by the UIImageDeprecated extension

use resizableImageWithCapInsets: and capInsets.
toString() String
A string representation of this object.
inherited
zone() Pointer<_NSZone>
zone
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

alloc() UIImage
alloc
allocWithZone_(Pointer<_NSZone> zone) UIImage
allocWithZone:
animatedImageNamed_duration_(NSString name, double duration) UIImage?
read sequence of files with suffix starting at 0 or 1
animatedImageWithImages_duration_(NSArray images, double duration) UIImage?
animatedImageWithImages:duration:
animatedResizableImageNamed_capInsets_duration_(NSString name, ObjCObjectBase capInsets, double duration) UIImage?
sequence of files
animatedResizableImageNamed_capInsets_resizingMode_duration_(NSString name, ObjCObjectBase capInsets, UIImageResizingMode resizingMode, double duration) UIImage?
animatedResizableImageNamed:capInsets:resizingMode:duration:
getSupportsSecureCoding() bool
supportsSecureCoding
imageNamed_(NSString name) UIImage?
load from main bundle
imageNamed_inBundle_variableValue_withConfiguration_(NSString name, NSBundle? bundle, double value, UIImageConfiguration? configuration) UIImage?
Retrieve a image with the specified name and variable value (between 0 and 1).
imageNamed_inBundle_withConfiguration_(NSString name, NSBundle? bundle, UIImageConfiguration? configuration) UIImage?
imageNamed:inBundle:withConfiguration:
imageWithCGImage_(Pointer<CGImage> cgImage) UIImage
imageWithCGImage:
imageWithCGImage_scale_orientation_(Pointer<CGImage> cgImage, double scale, UIImageOrientation orientation) UIImage
imageWithCGImage:scale:orientation:
imageWithCIImage_(CIImage ciImage) UIImage
imageWithCIImage:
imageWithCIImage_scale_orientation_(CIImage ciImage, double scale, UIImageOrientation orientation) UIImage
imageWithCIImage:scale:orientation:
imageWithContentsOfFile_(NSString path) UIImage?
imageWithContentsOfFile:
imageWithData_(NSData data) UIImage?
imageWithData:
imageWithData_scale_(NSData data, double scale) UIImage?
imageWithData:scale:
isInstance(ObjCObjectBase obj) bool
Returns whether obj is an instance of UIImage.
new1() UIImage
new
objectWithItemProviderData_typeIdentifier_error_(NSData data, NSString typeIdentifier, Pointer<Pointer<ObjCObject>> outError) UIImage?
objectWithItemProviderData:typeIdentifier:error:
systemImageNamed_(NSString name) UIImage?
Retrieve a system-provided image with the specified name. This will only return system-provided images. If you want a custom image as defined in your own catalogs, you should use +imageNamed:.
systemImageNamed_variableValue_withConfiguration_(NSString name, double value, UIImageConfiguration? configuration) UIImage?
Retrieve a system-provided image with the specified name and variable value (between 0 and 1).
systemImageNamed_withConfiguration_(NSString name, UIImageConfiguration? configuration) UIImage?
systemImageNamed:withConfiguration: