Edit

Share via


WKInterfaceImage.SetImage Method

Definition

Overloads

SetImage(NSData)

Sets the image to the specified imageData or shows nothing if null is passed.

SetImage(String)

Sets the image to the specified imageName file in the Watch bundle or device-side cache.

SetImage(UIImage)

SetImage(NSData)

Sets the image to the specified imageData or shows nothing if null is passed.

[Foundation.Export("setImageData:")]
public virtual void SetImage (Foundation.NSData imageData);
abstract member SetImage : Foundation.NSData -> unit
override this.SetImage : Foundation.NSData -> unit

Parameters

imageData
NSData

Raw image data or an archived UIImage.

This parameter can be null.

Attributes

Remarks

If the imageData contains multiple images, the resulting image will be animated.

The size of the WKInterfaceImage is determined by the imageData. If the result is larger than the screen, the image will be clipped.

Applies to

SetImage(String)

Sets the image to the specified imageName file in the Watch bundle or device-side cache.

[Foundation.Export("setImageNamed:")]
public virtual void SetImage (string imageName);
abstract member SetImage : string -> unit
override this.SetImage : string -> unit

Parameters

imageName
String

A file in the Watch bundle or on the device-side cache.

This parameter can be null.

Attributes

Remarks

The Watch bundle is searched first for the corresponding file name (which should include the file extension). If the bundle does not contain the image, the device-side cache is then searched.

If the file contains multiple images, the resulting image will be animated.

The size of the WKInterfaceImage is determined by the file. If the result is larger than the screen, the image will be clipped.

Applies to

SetImage(UIImage)

[Foundation.Export("setImage:")]
public virtual void SetImage (UIKit.UIImage image);
abstract member SetImage : UIKit.UIImage -> unit
override this.SetImage : UIKit.UIImage -> unit

Parameters

image
UIImage

To be added.

This parameter can be null.

Attributes

Applies to