ImageView.SetImage
------------------

Sets the image to be shown in the image view.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [ImageView](component_ImageView.md) | [7.4](newinversion74.md) | ✅ Yes | ❌ No | ❌ No | ❌ No | ✅ Yes |

MBS( "ImageView.SetImage"; ImageView; Image ) 

**MBS**( **"ImageView.SetImage";** /\* Sets the image to be shown in the image view. \*/  
**$ImageView**; /\* The image view reference number.e.g. $$ImageView \*/   
**$Image**) /\* the image to use.   
For best results, pass a container value with a PNG image.  
For animation, pass a GIF image. \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| ImageView | The image view reference number. | $$ImageView |
| Image | the image to use.    For best results, pass a container value with a PNG image.   For animation, pass a GIF image. |  |

### Result

Returns OK or error.

### Description

Sets the image to be shown in the image view.  
We treat GIF images special and animate them.  
### Examples

Sets image:

 Set Variable \[ $r ; Value: MBS ("ImageView.SetImage"; $$ImageView ; ImageView::ImageContainer ) \]  
### See also

- [ImageView.CreateWithControl](ImageViewCreateWithControl.md)
- [ImageView.CreateWithSize](ImageViewCreateWithSize.md)
- [ImageView.GetTag](ImageViewGetTag.md)
- [ImageView.Release](ImageViewRelease.md)
- [ImageView.SetFrame](ImageViewSetFrame.md)
- [ImageView.SetTag](ImageViewSetTag.md)

### Example Databases

- [Mac and iOS/ImageView](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Mac%20and%20iOS/ImageView.shtml#1ScriptAnchor_)
- [Mac and iOS/Machine Learning/Core ML Photos](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Mac%20and%20iOS/Machine%20Learning/Core%20ML%20Photos.shtml#10ScriptAnchor_)

This function is free to use.

Created 14th September 2017 , last changed 14th September 2017

  
[ImageView.SetFrameWithControl](ImageViewSetFrameWithControl.md) - [ImageView.SetTag](ImageViewSetTag.md)

[HTML Version](ImageViewSetImage.shtml)