Sdílet prostřednictvím


UIImage Class

Definition

[Foundation.Register("UIImage", true)]
public class UIImage : Foundation.NSObject, Foundation.INSItemProviderReading, Foundation.INSItemProviderWriting, Foundation.INSSecureCoding, IDisposable, UIKit.IUIAccessibilityIdentification, UIKit.IUIItemProviderPresentationSizeProviding
[Foundation.Register("UIImage", true)]
public class UIImage : Foundation.NSObject, Foundation.INSSecureCoding, IDisposable, UIKit.IUIAccessibilityIdentification
[<Foundation.Register("UIImage", true)>]
type UIImage = class
    inherit NSObject
    interface INSCoding
    interface INativeObject
    interface IDisposable
    interface INSItemProviderReading
    interface INSItemProviderWriting
    interface INSSecureCoding
    interface IUIAccessibilityIdentification
    interface IUIItemProviderPresentationSizeProviding
[<Foundation.Register("UIImage", true)>]
type UIImage = class
    inherit NSObject
    interface INSCoding
    interface INativeObject
    interface IDisposable
    interface INSSecureCoding
    interface IUIAccessibilityIdentification
Inheritance
UIImage
Attributes
Implements

Constructors

Name Description
UIImage()

Creates a new UIImage with default values.

UIImage(CGImage, NFloat, UIImageOrientation)
UIImage(CGImage)
UIImage(CIImage, NFloat, UIImageOrientation)

Constructs a new UIImage backed by the ciImage, scaled and oriented as specified.

UIImage(CIImage)
UIImage(NativeHandle)

A constructor used when creating managed representations of unmanaged objects. Called by the runtime.

UIImage(NSCoder)

A constructor that initializes the object from the data stored in the unarchiver object.

UIImage(NSData, NFloat)

Constructs a UIImage from the provided data, scaled by the scale factor.

UIImage(NSData)
UIImage(NSObjectFlag)

Constructor to call on derived classes to skip initialization and merely allocate the object.

UIImage(String)

Properties

Name Description
AccessibilityActivationPoint
AccessibilityAttributedHint
AccessibilityAttributedLabel
AccessibilityAttributedUserInputLabels
AccessibilityAttributedValue
AccessibilityDirectTouchOptions
AccessibilityElementsHidden
AccessibilityExpandedStatus
AccessibilityFrame
AccessibilityHeaderElements
AccessibilityHint
AccessibilityIdentifier

Uniquely identifies this for the purposes of accessibility.

AccessibilityLabel
AccessibilityLanguage
AccessibilityNavigationStyle
AccessibilityPath
AccessibilityRespondsToUserInteraction
AccessibilityTextualContext
AccessibilityTraits
AccessibilityUserInputLabels
AccessibilityValue
AccessibilityViewIsModal
ActionsImage
AddImage
AlignmentRectInsets
AnnouncementDidFinishNotification

Notification constant for AnnouncementDidFinish

AnnouncementNotification

Gets the notification posted by an application that an announcement requires assistive technology.

AssistiveTechnologyKey

Notification constant for AssistiveTechnologyKey

AssistiveTouchStatusDidChangeNotification

Notification constant for AssistiveTouchStatusDidChange

BaselineOffsetFromBottom
BoldTextStatusDidChangeNotification

Notification constant for BoldTextStatusDidChange

ButtonShapesEnabledStatusDidChangeNotification

Notification constant for ButtonShapesEnabledStatusDidChange

CapInsets
CGImage
CheckmarkImage
CIImage
Class (Inherited from NSObject)
ClassHandle

The Objective-C class handle for this class.

ClosedCaptioningStatusDidChangeNotification

Notification constant for ClosedCaptioningStatusDidChange

Configuration
CurrentScale
DarkerSystemColorsStatusDidChangeNotification

Notification constant for DarkerSystemColorsStatusDidChange

DebugDescription (Inherited from NSObject)
Description (Inherited from NSObject)
Duration
ElementFocusedNotification

Notification constant for ElementFocused

FlipsForRightToLeftLayoutDirection
FocusedElementKey

Notification constant for FocusedElementKey

GrayscaleStatusDidChangeNotification

Notification constant for GrayscaleStatusDidChange

GuidedAccessStatusDidChangeNotification

Notification constant for GuidedAccessStatusDidChange

Handle

Handle (pointer) to the unmanaged object representation.

(Inherited from NSObject)
HasBaseline
HearingDevicePairedEarDidChangeNotification

Notification constant for HearingDevicePairedEarDidChange

HeicRepresentation
ImageAsset
ImageRendererFormat
ImageRestrictedToStandardDynamicRange
Images
InvertColorsStatusDidChangeNotification

Notification constant for InvertColorsStatusDidChange

IsAccessibilityElement
IsDirectBinding (Inherited from NSObject)
IsHighDynamicRange
IsProxy (Inherited from NSObject)
LayoutChangedNotification

Gets the notification posted by an application that the layout of a screen has changed.

LeftCapWidth
MonoAudioStatusDidChangeNotification

Notification constant for MonoAudioStatusDidChange

NotificationSwitchControlIdentifier

Notification constant for NotificationSwitchContr

NotificationVoiceOverIdentifier

Notification constant for NotificationVoiceOv

OnOffSwitchLabelsDidChangeNotification

Notification constant for OnOffSwitchLabelsDidChange

Orientation
PageScrolledNotification

Gets the notification posted by an application that a scroll action has finished.

PauseAssistiveTechnologyNotification

Pauses assistive technology notifications.

PreferredPresentationSizeForItemProvider
PrefersCrossFadeTransitionsStatusDidChangeNotification

Notification constant for PrefersCrossFadeTransitionsStatusDidChange

ReadableTypeIdentifiers

Gets the array of Uniform Type Identifiers (UTIs) for the image.

ReduceMotionStatusDidChangeNotification

Notification constant for ReduceMotionStatusDidChange

ReduceTransparencyStatusDidChangeNotification

Notification constant for ReduceTransparencyStatusDidChange

RemoveImage
RenderingMode
ResizingMode
ResumeAssistiveTechnologyNotification

Resumes assistive technology notifications.

RetainCount (Inherited from NSObject)
ScreenChangedNotification

Gets the notification posted by an application that a new view appears that includes a major portion of the screen.

Self (Inherited from NSObject)
ShakeToUndoDidChangeNotification

Notification constant for ShakeToUndoDidChange

ShouldDifferentiateWithoutColorDidChangeNotification

Notification constant for ShouldDifferentiateWithoutColorDidChange

ShouldGroupAccessibilityChildren
Size
SpeakScreenStatusDidChangeNotification

Notification constant for SpeakScreenStatusDidChange

SpeakSelectionStatusDidChangeNotification

Notification constant for SpeakSelectionStatusDidChange

SpeechAttributeAnnouncementPriority

Represents the value associated with the constant 'UIAccessibilitySpeechAttributeAnnouncementPriority'.

SpeechAttributeIpaNotation

Returns the IPA notation for the accessibility attributed string.

SpeechAttributeLanguage

Gets a BCP-47 language code.

SpeechAttributePitch

Gets the value from 0.0 to 2.0 that determines the pitch for a spoken string.

SpeechAttributePunctuation

Gets a value to be interpreted as a bool that determines whether the punctuation in a string is pronounced.

SpeechAttributeQueueAnnouncement

Key for option that spoken text interrupt existing spoken content.

SpeechAttributeSpellOut

Represents the value associated with the constant 'UIAccessibilitySpeechAttributeSpellOut'.

StrokedCheckmarkImage
Superclass (Inherited from NSObject)
SuperHandle

Handle used to represent the methods in the base class for this NSObject.

(Inherited from NSObject)
SwitchControlStatusDidChangeNotification

Notification constant for SwitchControlStatusDidChange

SymbolConfiguration
SymbolImage
TextAttributeContext

Represents the value associated with the constant 'UIAccessibilityTextAttributeContext'.

TextAttributeCustom

Key for option that custom attributes be applied to the accessibility text.

TextAttributeHeadingLevel

Key for option of the accessibility text's heading level.

TopCapHeight
TraitAdjustable
Obsolete.

Gets a trait that allows continuous adjustment of an accessibility element through a range of values.

TraitAllowsDirectInteraction
Obsolete.

Gets a trait that allows direct touch interaction for users.

TraitButton
Obsolete.

Gets a trait that indicates that this IUIAccessibilityIdentification element should be treated as a button.

TraitCausesPageTurn
Obsolete.

Gets a trait that indicates that this IUIAccessibilityIdentification element should turn the page when VoiceOver finishes that page.

TraitCollection
TraitHeader
Obsolete.

Gets a trait that indicates that this IUIAccessibilityIdentification element is a header that divides content into sections.

TraitImage
Obsolete.

Gets a trait that indicates that this IUIAccessibilityIdentification element should be treated as an image.

TraitKeyboardKey
Obsolete.

Gets a trait that indicates that this IUIAccessibilityIdentification element acts like a keyboard key.

TraitLink
Obsolete.

Gets a trait that indicates that this IUIAccessibilityIdentification element should be considered a link.

TraitNone
Obsolete.

Gets a trait that indicates that this IUIAccessibilityIdentification element has no traits.

TraitNotEnabled
Obsolete.

Gets a trait that indicates that this IUIAccessibilityIdentification element is not enabled.

TraitPlaysSound
Obsolete.

Gets a trait that indicates that this IUIAccessibilityIdentification elements plays its own sound when activated.

TraitSearchField
Obsolete.

Gets a trait that indicates that this IUIAccessibilityIdentification element should be considered a search field.

TraitSelected
Obsolete.

Gets a trait that indicates that this IUIAccessibilityIdentification element is selected.

TraitStartsMediaSession
Obsolete.

Gets a trait that indicates that this IUIAccessibilityIdentification element starts a media session when it is activated.

TraitStaticText
Obsolete.

Gets a trait that indicates that this IUIAccessibilityIdentification element should be treated as static text.

TraitSummaryElement
Obsolete.

Gets a trait that provides summary information when an application starts.

TraitTabBar
Obsolete.

Represents the value associated with the constant 'UIAccessibilityTraitTabBar'.

TraitUpdatesFrequently
Obsolete.

Gets a trait that indicates that this IUIAccessibilityIdentification element updates its AccessibilityLabel or AccessibilityValue.

UnfocusedElementKey

Notification constant for UnfocusedElementKey

VideoAutoplayStatusDidChangeNotification

Notification constant for VideoAutoplayStatusDidChange

VoiceOverStatusChanged

Developers should not use this deprecated property. Developers should use 'VoiceOverStatusDidChangeNotification' instead.

VoiceOverStatusDidChangeNotification

Notification constant for VoiceOverStatusDidChange

WritableTypeIdentifiers

Gets the array of uniform type identifiers that specify which data types can be loaded into a color.

WritableTypeIdentifiersForItemProvider
Zone (Inherited from NSObject)

Methods

Name Description
AccessibilityActivate()
AddObserver(NSObject, NSString, NSKeyValueObservingOptions, IntPtr) (Inherited from NSObject)
AddObserver(NSObject, String, NSKeyValueObservingOptions, IntPtr) (Inherited from NSObject)
AddObserver(NSString, NSKeyValueObservingOptions, Action<NSObservedChange>)

Registers an object for being observed externally using an arbitrary method.

(Inherited from NSObject)
AddObserver(String, NSKeyValueObservingOptions, Action<NSObservedChange>)

Registers an object for being observed externally using an arbitrary method.

(Inherited from NSObject)
ApplyConfiguration(UIImageConfiguration)
ApplyConfiguration(UIImageSymbolConfiguration)
ApplyTintColor(UIColor, UIImageRenderingMode)
ApplyTintColor(UIColor)
AsJPEG()

Encodes the image with minimal compression (maximum quality) into a NSData byte blob using the JPEG encoding.

AsJPEG(NFloat)

Encodes the image into a NSData byte blob using the JPEG encoding.

AsPNG()

Encodes the image into a NSData byte blob using the PNG encoding.

AwakeFromNib() (Inherited from NSObject)
BeginInvokeOnMainThread(Action) (Inherited from NSObject)
BeginInvokeOnMainThread(Selector, NSObject)

Invokes asynchrously the specified code on the main UI thread.

(Inherited from NSObject)
ConformsToProtocol(NativeHandle) (Inherited from NSObject)
Copy() (Inherited from NSObject)
CreateAnimatedImage(String, Double)
CreateAnimatedImage(String, UIEdgeInsets, Double)
CreateAnimatedImage(String, UIEdgeInsets, UIImageResizingMode, Double)
CreateAnimatedImage(UIImage[], Double)
CreateResizableImage(UIEdgeInsets, UIImageResizingMode)
CreateResizableImage(UIEdgeInsets)
DangerousAutorelease()

Calls the 'autorelease' selector on this object.

(Inherited from NSObject)
DangerousRelease()

Calls the 'release' selector on this object.

(Inherited from NSObject)
DangerousRetain()

Calls the 'retain' selector on this object.

(Inherited from NSObject)
DidChange(NSKeyValueChange, NSIndexSet, NSString) (Inherited from NSObject)
DidChange(NSString, NSKeyValueSetMutationKind, NSSet) (Inherited from NSObject)
DidChangeValue(String) (Inherited from NSObject)
Dispose()

Releases the resources used by the NSObject object.

(Inherited from NSObject)
Dispose(Boolean)

Releases the resources used by the NSObject object.

(Inherited from NSObject)
DoesNotRecognizeSelector(Selector) (Inherited from NSObject)
Draw(CGPoint, CGBlendMode, NFloat)

Draws the UIImage into the current graphics context at the specified point, with blending mode and alpha as specified.

Draw(CGPoint)
Draw(CGRect, CGBlendMode, NFloat)

Draws the UIImage into the current graphics context in the specified rect, with blending mode and alpha as specified.

Draw(CGRect)
DrawAsPatternInRect(CGRect)
EncodeTo(NSCoder)

Encodes the state of the object using the provided encoder.

Equals(NSObject) (Inherited from NSObject)
Equals(Object) (Inherited from NSObject)
FromBundle(String, NSBundle, Double, UIImageConfiguration)
FromBundle(String, NSBundle, UIImageConfiguration)
FromBundle(String, NSBundle, UITraitCollection)
FromBundle(String)
FromFile(String)
FromImage(CGImage, NFloat, UIImageOrientation)

Static factory method to create a UIImage backed by the specified image, scaled and oriented as specified.

FromImage(CGImage)
FromImage(CIImage, NFloat, UIImageOrientation)

Static factory method to create a UIImage backed by the specified ciImage, scaled and oriented as specified.

FromImage(CIImage)
FromResource(Assembly, String)

Loads an image from a resource embedded in the assembly.

GetDictionaryOfValuesFromKeys(NSString[]) (Inherited from NSObject)
GetHashCode()

Generates a hash code for the current instance.

(Inherited from NSObject)
GetImageByPreparingForDisplay()
GetImageByPreparingThumbnail(CGSize)
GetImageFlippedForRightToLeftLayoutDirection()
GetImageFromBottom(NFloat)
GetImageWithHorizontallyFlippedOrientation()
GetImageWithoutBaseline()
GetItemProviderVisibilityForTypeIdentifier(String)
GetMethodForSelector(Selector) (Inherited from NSObject)
GetNativeHash() (Inherited from NSObject)
GetObject(NSData, String, NSError)

Static factory method to create a UIImage from data, with typeIdentifier being the appropriate UTI.

GetSystemImage(String, Double, UIImageConfiguration)
GetSystemImage(String, UIImageConfiguration)
GetSystemImage(String, UITraitCollection)
GetSystemImage(String)
ImageWithAlignmentRectInsets(UIEdgeInsets)
ImageWithRenderingMode(UIImageRenderingMode)
Init() (Inherited from NSObject)
InitializeHandle(NativeHandle, String) (Inherited from NSObject)
InitializeHandle(NativeHandle) (Inherited from NSObject)
Invoke(Action, Double) (Inherited from NSObject)
Invoke(Action, TimeSpan) (Inherited from NSObject)
InvokeOnMainThread(Action) (Inherited from NSObject)
InvokeOnMainThread(Selector, NSObject)

Invokes synchrously the specified code on the main UI thread.

(Inherited from NSObject)
IsEqual(NSObject) (Inherited from NSObject)
IsKindOfClass(Class) (Inherited from NSObject)
IsMemberOfClass(Class) (Inherited from NSObject)
LoadData(String, Action<NSData,NSError>)

Implement this method to customize the loading of data by an NSItemProvider.

LoadDataAsync(String, NSProgress)
LoadDataAsync(String)

Asynchronously loads data for the identified type from an item provider, returning a task that contains the data.

LoadFromData(NSData, NFloat)

Factory method to create a UIImage from the provided data, at the specified scale.

LoadFromData(NSData)
MarkDirty()

Promotes a regular peer object (IsDirectBinding is true) into a toggleref object.

(Inherited from NSObject)
MutableCopy() (Inherited from NSObject)
ObserveValue(NSString, NSObject, NSDictionary, IntPtr) (Inherited from NSObject)
PerformSelector(Selector, NSObject, Double, NSString[]) (Inherited from NSObject)
PerformSelector(Selector, NSObject, Double) (Inherited from NSObject)
PerformSelector(Selector, NSObject, NSObject) (Inherited from NSObject)
PerformSelector(Selector, NSObject) (Inherited from NSObject)
PerformSelector(Selector, NSThread, NSObject, Boolean, NSString[]) (Inherited from NSObject)
PerformSelector(Selector, NSThread, NSObject, Boolean) (Inherited from NSObject)
PerformSelector(Selector) (Inherited from NSObject)
PrepareForDisplay(Action<UIImage>)
PrepareForDisplayAsync()
PrepareForInterfaceBuilder() (Inherited from NSObject)
PrepareThumbnail(CGSize, Action<UIImage>)
PrepareThumbnailAsync(CGSize)
RemoveObserver(NSObject, NSString, IntPtr) (Inherited from NSObject)
RemoveObserver(NSObject, NSString) (Inherited from NSObject)
RemoveObserver(NSObject, String, IntPtr) (Inherited from NSObject)
RemoveObserver(NSObject, String) (Inherited from NSObject)
RespondsToSelector(Selector) (Inherited from NSObject)
SaveToPhotosAlbum(UIImage+SaveStatus)

Saves the specified image into the Photos Album.

Scale(CGSize, NFloat)

Scales the image up or down.

Scale(CGSize)

Scales the image up or down.

SetNilValueForKey(NSString) (Inherited from NSObject)
SetValueForKey(NSObject, NSString) (Inherited from NSObject)
SetValueForKeyPath(NativeHandle, NSString) (Inherited from NSObject)
SetValueForKeyPath(NSObject, NSString) (Inherited from NSObject)
SetValueForUndefinedKey(NSObject, NSString) (Inherited from NSObject)
SetValuesForKeysWithDictionary(NSDictionary) (Inherited from NSObject)
StretchableImage(IntPtr, IntPtr)

Creates a stretchable image with the specified parameters. Deprecated in iOS 5, but still useful since the replacement is known to have bugs.

ToString()

Returns a string representation of the value of the current instance.

(Inherited from NSObject)
ValueForKey(NSString) (Inherited from NSObject)
ValueForKeyPath(NSString) (Inherited from NSObject)
ValueForUndefinedKey(NSString) (Inherited from NSObject)
WillChange(NSKeyValueChange, NSIndexSet, NSString) (Inherited from NSObject)
WillChange(NSString, NSKeyValueSetMutationKind, NSSet) (Inherited from NSObject)
WillChangeValue(String) (Inherited from NSObject)

Extension Methods

Name Description
BrowserAccessibilityDeleteTextAtCursor(NSObject, IntPtr)
BrowserAccessibilityInsertTextAtCursor(NSObject, String)
GetAccessibilityLineEndPositionFromCurrentSelection(NSObject)
GetAccessibilityLineRangeForPosition(NSObject, IntPtr)
GetAccessibilityLineStartPositionFromCurrentSelection(NSObject)
GetBrowserAccessibilityAttributedValue(NSObject, NSRange)
GetBrowserAccessibilityContainerType(NSObject)
GetBrowserAccessibilityCurrentStatus(NSObject)
GetBrowserAccessibilityHasDomFocus(NSObject)
GetBrowserAccessibilityIsRequired(NSObject)
GetBrowserAccessibilityPressedState(NSObject)
GetBrowserAccessibilityRoleDescription(NSObject)
GetBrowserAccessibilitySelectedTextRange(NSObject)
GetBrowserAccessibilitySortDirection(NSObject)
GetBrowserAccessibilityValue(NSObject, NSRange)
SetBrowserAccessibilityContainerType(NSObject, BEAccessibilityContainerType)
SetBrowserAccessibilityCurrentStatus(NSObject, String)
SetBrowserAccessibilityHasDomFocus(NSObject, Boolean)
SetBrowserAccessibilityIsRequired(NSObject, Boolean)
SetBrowserAccessibilityPressedState(NSObject, BEAccessibilityPressedState)
SetBrowserAccessibilityRoleDescription(NSObject, String)
SetBrowserAccessibilitySelectedTextRange(NSObject, NSRange)
SetBrowserAccessibilitySortDirection(NSObject, String)
ProvideImageData(NSObject, IntPtr, UIntPtr, UIntPtr, UIntPtr, UIntPtr, UIntPtr, NSObject)
ProvideImageToMTLTexture(NSObject, IMTLTexture, IMTLCommandBuffer, UIntPtr, UIntPtr, UIntPtr, UIntPtr, NSObject)
GetItemProviderVisibilityForTypeIdentifier(INSItemProviderWriting, String)
GetWritableTypeIdentifiersForItemProvider(INSItemProviderWriting)
LoadDataAsync(INSItemProviderWriting, String, NSProgress)
LoadDataAsync(INSItemProviderWriting, String)

Asynchronously loads data for the identified type from an item provider, returning a task that contains the data.

SetSharedObservers(NSObject, NSKeyValueSharedObserversSnapshot)
GetDebugDescription(INSObjectProtocol)
GetHandle(INativeObject)
GetNonNullHandle(INativeObject, String)
GetAccessibilityCustomRotors(NSObject)

Gets the array of UIAccessibilityCustomRotor objects appropriate for this object.

SetAccessibilityCustomRotors(NSObject, UIAccessibilityCustomRotor[])

Sets the array of UIAccessibilityCustomRotor objects appropriate for this object.

AccessibilityHitTest(NSObject, CGPoint, UIEvent)
GetAccessibilityNextTextNavigationElement(NSObject)
GetAccessibilityNextTextNavigationElementBlock(NSObject)
GetAccessibilityPreviousTextNavigationElement(NSObject)
GetAccessibilityPreviousTextNavigationElementBlock(NSObject)
SetAccessibilityNextTextNavigationElement(NSObject, NSObject)
SetAccessibilityNextTextNavigationElementBlock(NSObject, AXObjectReturnBlock)
SetAccessibilityPreviousTextNavigationElement(NSObject, NSObject)
SetAccessibilityPreviousTextNavigationElementBlock(NSObject, AXObjectReturnBlock)
GetAccessibilityTextInputResponder(NSObject)
GetAccessibilityTextInputResponderHandler(NSObject)
SetAccessibilityTextInputResponder(NSObject, IUITextInput)
SetAccessibilityTextInputResponderHandler(NSObject, UITextInputReturnHandler)

Applies to