Method ToImageSource
ToImageSource(RuntimeImage?)
Converts a RuntimeImage to a platform-native image type synchronously.
Declaration
public static ImageSource? ToImageSource(this RuntimeImage? image)
Parameters
| Type | Name | Description |
|---|---|---|
| RuntimeImage | image | Runtime Image to convert |
Returns
| Type | Description |
|---|---|
| ImageSource | A native platform bitmap image |
Remarks
You can use this method in a XAML function binding to convert a RuntimeImage to a platform-native image type. Example:
<Image Source="{x:Bind ui:RuntimeImageExtensions.ToImageSource(MyViewModel.RuntimeImage), Mode=OneWay}" xmlns:ui="using:Esri.ArcGISRuntime.UI" />
note
Note that if the RuntimeImage fails to load, an empty image will be returned. To handle load errors, either first call LoadAsync() or use the ToImageSourceAsync(RuntimeImage?) asynchronous method instead.
See Also
Applies to
Platforms and versions
| Target | Versions |
|---|---|
| .NET Windows | 300 |