Upravit

Sdílet prostřednictvím


WKInterfaceDevice.AddCachedImage Method

Definition

Overloads

AddCachedImage(NSData, String)

Adds an image defined in the imageData to the device's image cache.

AddCachedImage(UIImage, String)

AddCachedImage(NSData, String)

Adds an image defined in the imageData to the device's image cache.

[Foundation.Export("addCachedImageWithData:name:")]
[ObjCRuntime.Unavailable(ObjCRuntime.PlatformName.WatchOS, ObjCRuntime.PlatformArchitecture.All, null)]
public virtual bool AddCachedImage (Foundation.NSData imageData, string name);
abstract member AddCachedImage : Foundation.NSData * string -> bool
override this.AddCachedImage : Foundation.NSData * string -> bool

Parameters

imageData
NSData

The image data, either in native format or a serialized UIImage.

name
String

An identifier. If the value is already in the image cache, the existing image will be replaced.

Returns

true if the image was successfully added to the image cache.

Attributes

Remarks

Developers that wish to store animations should create the entire animation in a single UIImage (see CreateAnimatedImage(String, UIEdgeInsets, UIImageResizingMode, Double) overloads) and then serialize the resulting UIImage to NSData for the imageData argument.

Applies to

AddCachedImage(UIImage, String)

[Foundation.Export("addCachedImage:name:")]
[ObjCRuntime.Unavailable(ObjCRuntime.PlatformName.WatchOS, ObjCRuntime.PlatformArchitecture.All, null)]
public virtual bool AddCachedImage (UIKit.UIImage image, string name);
abstract member AddCachedImage : UIKit.UIImage * string -> bool
override this.AddCachedImage : UIKit.UIImage * string -> bool

Parameters

image
UIImage
name
String

Returns

Attributes

Applies to