Package apple.uikit

Class UIImage

    • Constructor Detail

      • UIImage

        protected UIImage​(org.moe.natj.general.Pointer peer)
    • Method Detail

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • alloc

        public static UIImage alloc()
      • allocWithZone

        public static UIImage allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • animatedImageNamedDuration

        @Nullable
        public static @Nullable UIImage animatedImageNamedDuration​(@NotNull
                                                                   @NotNull java.lang.String name,
                                                                   double duration)
        read sequence of files with suffix starting at 0 or 1 API-Since: 5.0
      • animatedImageWithImagesDuration

        @Nullable
        public static @Nullable UIImage animatedImageWithImagesDuration​(@NotNull
                                                                        @NotNull NSArray<? extends UIImage> images,
                                                                        double duration)
        API-Since: 5.0
      • animatedResizableImageNamedCapInsetsDuration

        @Nullable
        public static @Nullable UIImage animatedResizableImageNamedCapInsetsDuration​(@NotNull
                                                                                     @NotNull java.lang.String name,
                                                                                     UIEdgeInsets capInsets,
                                                                                     double duration)
        sequence of files API-Since: 5.0
      • animatedResizableImageNamedCapInsetsResizingModeDuration

        @Nullable
        public static @Nullable UIImage animatedResizableImageNamedCapInsetsResizingModeDuration​(@NotNull
                                                                                                 @NotNull java.lang.String name,
                                                                                                 UIEdgeInsets capInsets,
                                                                                                 long resizingMode,
                                                                                                 double duration)
        API-Since: 6.0
      • automaticallyNotifiesObserversForKey

        public static boolean automaticallyNotifiesObserversForKey​(@NotNull
                                                                   @NotNull java.lang.String key)
      • cancelPreviousPerformRequestsWithTarget

        public static void cancelPreviousPerformRequestsWithTarget​(@NotNull
                                                                   @NotNull java.lang.Object aTarget)
      • cancelPreviousPerformRequestsWithTargetSelectorObject

        public static void cancelPreviousPerformRequestsWithTargetSelectorObject​(@NotNull
                                                                                 @NotNull java.lang.Object aTarget,
                                                                                 @NotNull
                                                                                 @NotNull org.moe.natj.objc.SEL aSelector,
                                                                                 @Nullable
                                                                                 @Nullable java.lang.Object anArgument)
      • classFallbacksForKeyedArchiver

        @NotNull
        public static @NotNull NSArray<java.lang.String> classFallbacksForKeyedArchiver()
      • classForKeyedUnarchiver

        @NotNull
        public static @NotNull org.moe.natj.objc.Class classForKeyedUnarchiver()
      • debugDescription_static

        public static java.lang.String debugDescription_static()
      • description_static

        public static java.lang.String description_static()
      • hash_static

        public static long hash_static()
      • imageNamed

        @Nullable
        public static @Nullable UIImage imageNamed​(@NotNull
                                                   @NotNull java.lang.String name)
        load from main bundle
      • imageNamedInBundleCompatibleWithTraitCollection

        @Nullable
        public static @Nullable UIImage imageNamedInBundleCompatibleWithTraitCollection​(@NotNull
                                                                                        @NotNull java.lang.String name,
                                                                                        @Nullable
                                                                                        @Nullable NSBundle bundle,
                                                                                        @Nullable
                                                                                        @Nullable UITraitCollection traitCollection)
        API-Since: 8.0
      • imageWithCGImage

        @NotNull
        public static @NotNull UIImage imageWithCGImage​(@NotNull
                                                        @NotNull CGImageRef cgImage)
      • imageWithCGImageScaleOrientation

        @NotNull
        public static @NotNull UIImage imageWithCGImageScaleOrientation​(@NotNull
                                                                        @NotNull CGImageRef cgImage,
                                                                        double scale,
                                                                        long orientation)
        API-Since: 4.0
      • imageWithCIImage

        @NotNull
        public static @NotNull UIImage imageWithCIImage​(@NotNull
                                                        @NotNull CIImage ciImage)
        API-Since: 5.0
      • imageWithCIImageScaleOrientation

        @NotNull
        public static @NotNull UIImage imageWithCIImageScaleOrientation​(@NotNull
                                                                        @NotNull CIImage ciImage,
                                                                        double scale,
                                                                        long orientation)
        API-Since: 6.0
      • imageWithContentsOfFile

        @Nullable
        public static @Nullable UIImage imageWithContentsOfFile​(@NotNull
                                                                @NotNull java.lang.String path)
      • imageWithData

        @Nullable
        public static @Nullable UIImage imageWithData​(@NotNull
                                                      @NotNull NSData data)
      • imageWithDataScale

        @Nullable
        public static @Nullable UIImage imageWithDataScale​(@NotNull
                                                           @NotNull NSData data,
                                                           double scale)
        API-Since: 6.0
      • instanceMethodSignatureForSelector

        public static NSMethodSignature instanceMethodSignatureForSelector​(org.moe.natj.objc.SEL aSelector)
      • instancesRespondToSelector

        public static boolean instancesRespondToSelector​(org.moe.natj.objc.SEL aSelector)
      • isSubclassOfClass

        public static boolean isSubclassOfClass​(org.moe.natj.objc.Class aClass)
      • keyPathsForValuesAffectingValueForKey

        @NotNull
        public static @NotNull NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(@NotNull
                                                                                             @NotNull java.lang.String key)
      • new_objc

        public static UIImage new_objc()
      • resolveClassMethod

        public static boolean resolveClassMethod​(org.moe.natj.objc.SEL sel)
      • resolveInstanceMethod

        public static boolean resolveInstanceMethod​(org.moe.natj.objc.SEL sel)
      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • superclass_static

        public static org.moe.natj.objc.Class superclass_static()
      • supportsSecureCoding

        public static boolean supportsSecureCoding()
      • version_static

        public static long version_static()
      • CGImage

        @Nullable
        public @Nullable CGImageRef CGImage()
      • CIImage

        @Nullable
        public @Nullable CIImage CIImage()
        returns underlying CIImage or nil if CGImageRef based API-Since: 5.0
      • alignmentRectInsets

        public UIEdgeInsets alignmentRectInsets()
        API-Since: 6.0
      • capInsets

        public UIEdgeInsets capInsets()
        default is UIEdgeInsetsZero for non resizable images API-Since: 5.0
      • drawAsPatternInRect

        public void drawAsPatternInRect​(CGRect rect)
        draws the image as a CGPattern
      • drawAtPoint

        public void drawAtPoint​(CGPoint point)
        mode = kCGBlendModeNormal, alpha = 1.0
      • drawAtPointBlendModeAlpha

        public void drawAtPointBlendModeAlpha​(CGPoint point,
                                              int blendMode,
                                              double alpha)
      • drawInRect

        public void drawInRect​(CGRect rect)
        mode = kCGBlendModeNormal, alpha = 1.0
      • drawInRectBlendModeAlpha

        public void drawInRectBlendModeAlpha​(CGRect rect,
                                             int blendMode,
                                             double alpha)
      • duration

        public double duration()
        total duration for all frames. default is 0 for non-animated images API-Since: 5.0
      • flipsForRightToLeftLayoutDirection

        public boolean flipsForRightToLeftLayoutDirection()
        API-Since: 9.0
      • imageAsset

        @Nullable
        public @Nullable UIImageAsset imageAsset()
        The asset is not encoded along with the image. Returns nil if the image is not CGImage based. API-Since: 8.0
      • imageFlippedForRightToLeftLayoutDirection

        @NotNull
        public @NotNull UIImage imageFlippedForRightToLeftLayoutDirection()
        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. API-Since: 9.0
      • imageOrientation

        public long imageOrientation()
        this will affect how the image is composited
      • imageRendererFormat

        @NotNull
        public @NotNull UIGraphicsImageRendererFormat imageRendererFormat()
        Returns an optimal UIGraphicsImageRendererFormat instance for this image, maintaining pixel format and color space. API-Since: 10.0
      • imageWithAlignmentRectInsets

        @NotNull
        public @NotNull UIImage imageWithAlignmentRectInsets​(UIEdgeInsets alignmentInsets)
        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. API-Since: 6.0
      • imageWithHorizontallyFlippedOrientation

        @NotNull
        public @NotNull UIImage imageWithHorizontallyFlippedOrientation()
        Creates a version of this image with an imageOrientation property that is horizontally mirrored from this image’s. Does not affect the flipsForRightToLeftLayoutDirection property. API-Since: 10.0
      • imageWithRenderingMode

        @NotNull
        public @NotNull UIImage imageWithRenderingMode​(long renderingMode)
        Create a version of this image with the specified rendering mode. By default, images have a rendering mode of UIImageRenderingModeAutomatic. API-Since: 7.0
      • images

        @Nullable
        public @Nullable NSArray<? extends UIImage> images()
        default is nil for non-animated images API-Since: 5.0
      • initWithCGImage

        public UIImage initWithCGImage​(@NotNull
                                       @NotNull CGImageRef cgImage)
      • initWithCGImageScaleOrientation

        public UIImage initWithCGImageScaleOrientation​(@NotNull
                                                       @NotNull CGImageRef cgImage,
                                                       double scale,
                                                       long orientation)
        API-Since: 4.0
      • initWithCIImage

        public UIImage initWithCIImage​(@NotNull
                                       @NotNull CIImage ciImage)
        API-Since: 5.0
      • initWithCIImageScaleOrientation

        public UIImage initWithCIImageScaleOrientation​(@NotNull
                                                       @NotNull CIImage ciImage,
                                                       double scale,
                                                       long orientation)
        API-Since: 6.0
      • initWithContentsOfFile

        public UIImage initWithContentsOfFile​(@NotNull
                                              @NotNull java.lang.String path)
      • initWithData

        public UIImage initWithData​(@NotNull
                                    @NotNull NSData data)
      • initWithDataScale

        public UIImage initWithDataScale​(@NotNull
                                         @NotNull NSData data,
                                         double scale)
        API-Since: 6.0
      • leftCapWidth

        public long leftCapWidth()
        default is 0. if non-zero, horiz. stretchable. right cap is calculated as width - leftCapWidth - 1
      • renderingMode

        public long renderingMode()
        API-Since: 7.0
      • resizableImageWithCapInsets

        @NotNull
        public @NotNull UIImage resizableImageWithCapInsets​(UIEdgeInsets capInsets)
        create a resizable version of this image. the interior is tiled when drawn. API-Since: 5.0
      • resizableImageWithCapInsetsResizingMode

        @NotNull
        public @NotNull UIImage resizableImageWithCapInsetsResizingMode​(UIEdgeInsets capInsets,
                                                                        long resizingMode)
        the interior is resized according to the resizingMode API-Since: 6.0
      • resizingMode

        public long resizingMode()
        default is UIImageResizingModeTile API-Since: 6.0
      • scale

        public double scale()
        API-Since: 4.0
      • size

        public CGSize size()
        reflects orientation setting. In iOS 4.0 and later, this is measured in points. In 3.x and earlier, measured in pixels
      • stretchableImageWithLeftCapWidthTopCapHeight

        @NotNull
        public @NotNull UIImage stretchableImageWithLeftCapWidthTopCapHeight​(long leftCapWidth,
                                                                             long topCapHeight)
        use resizableImageWithCapInsets: and capInsets.
      • _supportsSecureCoding

        public boolean _supportsSecureCoding()
        Description copied from interface: NSSecureCoding
        This property must return YES on all classes that allow secure coding. Subclasses of classes that adopt NSSecureCoding and override initWithCoder: must also override this method and return YES. The Secure Coding Guide should be consulted when writing methods that decode data.
        Specified by:
        _supportsSecureCoding in interface NSSecureCoding
      • topCapHeight

        public long topCapHeight()
        default is 0. if non-zero, vert. stretchable. bottom cap is calculated as height - topCapWidth - 1
      • traitCollection

        @NotNull
        public @NotNull UITraitCollection traitCollection()
        describes the image in terms of its traits API-Since: 8.0
      • itemProviderVisibilityForRepresentationWithTypeIdentifier_static

        public static long itemProviderVisibilityForRepresentationWithTypeIdentifier_static​(@NotNull
                                                                                            @NotNull java.lang.String typeIdentifier)
      • itemProviderVisibilityForRepresentationWithTypeIdentifier

        public long itemProviderVisibilityForRepresentationWithTypeIdentifier​(@NotNull
                                                                              @NotNull java.lang.String typeIdentifier)
      • objectWithItemProviderDataTypeIdentifierError

        @Nullable
        public static @Nullable UIImage objectWithItemProviderDataTypeIdentifierError​(@NotNull
                                                                                      @NotNull NSData data,
                                                                                      @NotNull
                                                                                      @NotNull java.lang.String typeIdentifier,
                                                                                      @Nullable
                                                                                      @Nullable org.moe.natj.general.ptr.Ptr<NSError> outError)
      • readableTypeIdentifiersForItemProvider

        @NotNull
        public static @NotNull NSArray<java.lang.String> readableTypeIdentifiersForItemProvider()
      • writableTypeIdentifiersForItemProvider_static

        @NotNull
        public static @NotNull NSArray<java.lang.String> writableTypeIdentifiersForItemProvider_static()
      • writableTypeIdentifiersForItemProvider

        @NotNull
        public @NotNull NSArray<java.lang.String> writableTypeIdentifiersForItemProvider()
      • actionsImage

        @NotNull
        public static @NotNull UIImage actionsImage()
        API-Since: 13.0
      • addImage

        @NotNull
        public static @NotNull UIImage addImage()
        API-Since: 13.0
      • baselineOffsetFromBottom

        public double baselineOffsetFromBottom()
        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). API-Since: 13.0
      • checkmarkImage

        @NotNull
        public static @NotNull UIImage checkmarkImage()
        API-Since: 13.0
      • configuration

        @Nullable
        public @Nullable UIImageConfiguration configuration()
        Configuration support --------------------- This describes the configuration of the image. Depending on which type of image, the configuration might be different. Symbol images will always have a UIImageSymbolConfiguration, even if you give it another type of configuration (it will merge the trait info from the other configuration into its current configuration). Images start off with an unspecified configuration but can be modified by the methods below. The preferred ways of adding configurations for displaying images is to specify them on the image view, but it is possible to modify images with a more specific configuration. API-Since: 13.0
      • hasBaseline

        public boolean hasBaseline()
        API-Since: 13.0
      • imageByApplyingSymbolConfiguration

        @Nullable
        public @Nullable UIImage imageByApplyingSymbolConfiguration​(@NotNull
                                                                    @NotNull UIImageSymbolConfiguration configuration)
        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). Create a new image by applying the specified configuration over the existing one. This only works if the configuration already has a configuration (i.e. is a symbol image). The image will be configured with a combination of both configurations. If you use this on a symbol image with other layout modifications done (e.g. changed baseline), those changes will be lost and overwritten with the new configuration's layout properties. This applies to size, contentInsets and baseline. API-Since: 13.0
      • imageNamedInBundleWithConfiguration

        @Nullable
        public static @Nullable UIImage imageNamedInBundleWithConfiguration​(@NotNull
                                                                            @NotNull java.lang.String name,
                                                                            @Nullable
                                                                            @Nullable NSBundle bundle,
                                                                            @Nullable
                                                                            @Nullable UIImageConfiguration configuration)
        API-Since: 13.0
      • imageWithBaselineOffsetFromBottom

        @NotNull
        public @NotNull UIImage imageWithBaselineOffsetFromBottom​(double baselineOffset)
        API-Since: 13.0
      • imageWithConfiguration

        @NotNull
        public @NotNull UIImage imageWithConfiguration​(@NotNull
                                                       @NotNull UIImageConfiguration configuration)
        * 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. * * Important note! Given (for example): * * image = image(named:"the_image").withRenderingMode(.alwaysTemplate) * the following two statements aren't exactly equivalent: * * a = image.imageAsset.withConfiguration(configuration) * b = image.withConfiguration(configuration) * * The first one will resolve the image again from the asset catalog (if it is originating from one), * resulting in a fresh image without any modifications. In other words, `a` won't have the * rendering mode change set anymore, and it will be "reverted" to `.automatic`. * The second one will resolve the image, but apply and changes that were made to the image. * That means that `b` might be a different image, but it will still have the same rendering mode * as `image`. API-Since: 13.0
      • imageWithTintColor

        @NotNull
        public @NotNull UIImage imageWithTintColor​(@NotNull
                                                   @NotNull UIColor color)
        API-Since: 13.0
      • imageWithTintColorRenderingMode

        @NotNull
        public @NotNull UIImage imageWithTintColorRenderingMode​(@NotNull
                                                                @NotNull UIColor color,
                                                                long renderingMode)
        API-Since: 13.0
      • imageWithoutBaseline

        @NotNull
        public @NotNull UIImage imageWithoutBaseline()
        API-Since: 13.0
      • isSymbolImage

        public boolean isSymbolImage()
        API-Since: 13.0
      • removeImage

        @NotNull
        public static @NotNull UIImage removeImage()
        API-Since: 13.0
      • strokedCheckmarkImage

        @NotNull
        public static @NotNull UIImage strokedCheckmarkImage()
        API-Since: 13.0
      • symbolConfiguration

        @Nullable
        public @Nullable UIImageSymbolConfiguration symbolConfiguration()
        Symbol configuration support ---------------------------- This describes the symbol configuration of a symbol image. Symbol images start off with an unspecified configuration but can be modified by using `image.withConfiguration(:)`. However... the preferred ways of adding configurations for displaying images is to specify them on the image view using `preferredSymbolConfiguration`, but it is possible to modify images with a more specific configuration. This include image related traits, for example you can use this to fix a symbol image to a dynamic type style at a fixed preferred content size category. API-Since: 13.0
      • systemImageNamed

        @Nullable
        public static @Nullable UIImage systemImageNamed​(@NotNull
                                                         @NotNull java.lang.String name)
        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:. UIKit applications on macOS may pass NSImageName values (defined in ) for the name to access macOS system images. Returns nil if an image with specified name doesn't exist. API-Since: 13.0
      • systemImageNamedCompatibleWithTraitCollection

        @Nullable
        public static @Nullable UIImage systemImageNamedCompatibleWithTraitCollection​(@NotNull
                                                                                      @NotNull java.lang.String name,
                                                                                      @Nullable
                                                                                      @Nullable UITraitCollection traitCollection)
        API-Since: 13.0
      • systemImageNamedWithConfiguration

        @Nullable
        public static @Nullable UIImage systemImageNamedWithConfiguration​(@NotNull
                                                                          @NotNull java.lang.String name,
                                                                          @Nullable
                                                                          @Nullable UIImageConfiguration configuration)
        API-Since: 13.0
      • imageByPreparingForDisplay

        @Nullable
        public @Nullable UIImage imageByPreparingForDisplay()
        Synchronously prepares this image for displaying on the specified screen. [@note] The prepared UIImage is not related to the original image. If the properties of the screen (such as its resolution or color gamut) change, or if the image is displayed on a different screen that the one it was prepared for, it may not render correctly. API-Since: 15.0
        Returns:
        A UIImage object that contains the prepared image.
      • imageByPreparingThumbnailOfSize

        @Nullable
        public @Nullable UIImage imageByPreparingThumbnailOfSize​(CGSize size)
        API-Since: 15.0
      • prepareForDisplayWithCompletionHandler

        public void prepareForDisplayWithCompletionHandler​(@NotNull
                                                           @NotNull UIImage.Block_prepareForDisplayWithCompletionHandler completionHandler)
        Asynchronously prepares this image for displaying on the specified screen. The completion handler will be invoked on a private queue. Be sure to return to the main queue before assigning the prepared image to an image view. [@note] The prepared UIImage is not related to the original image. If the properties of the screen (such as its resolution or color gamut) change, or if the image is displayed on a different screen that the one it was prepared for, it may not render correctly. API-Since: 15.0
        Parameters:
        completionHandler - A block to invoke with the prepared image. If preparation failed (for example, beacuse the image data is corrupt), @c image will be nil.
      • imageNamedInBundleVariableValueWithConfiguration

        @Nullable
        public static @Nullable UIImage imageNamedInBundleVariableValueWithConfiguration​(@NotNull
                                                                                         @NotNull java.lang.String name,
                                                                                         @Nullable
                                                                                         @Nullable NSBundle bundle,
                                                                                         double value,
                                                                                         @Nullable
                                                                                         @Nullable UIImageConfiguration configuration)
        Retrieve a image with the specified name and variable value (between 0 and 1). This will only return custom images defined in your own catalogs. If you want a system-provided image, you should use @c +systemImageNamed:variableValue:withConfiguration:. Returns @c nil if an image with specified name doesn't exist. API-Since: 16.0
      • systemImageNamedVariableValueWithConfiguration

        @Nullable
        public static @Nullable UIImage systemImageNamedVariableValueWithConfiguration​(@NotNull
                                                                                       @NotNull java.lang.String name,
                                                                                       double value,
                                                                                       @Nullable
                                                                                       @Nullable UIImageConfiguration configuration)
        Retrieve a system-provided image with the specified name and variable value (between 0 and 1). This will only return system-provided images. If you want a custom image as defined in your own catalogs, you should use @c +imageNamed:inBundle:variableValue:withConfiguration:. Returns @c nil if an image with specified name doesn't exist. API-Since: 16.0
      • imageRestrictedToStandardDynamicRange

        @NotNull
        public @NotNull UIImage imageRestrictedToStandardDynamicRange()
        Returns a new image that will render within the standard range. API-Since: 17.0
      • isHighDynamicRange

        public boolean isHighDynamicRange()
        Indicates that this image is tagged for display of high dynamic range content. API-Since: 17.0
      • useStoredAccessor

        @Deprecated
        public static boolean useStoredAccessor()
        Deprecated.