<div class="meta" robots="noindex">

</div>

Class

# iOSImage

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

<div class="warning">

<div class="title">

Warning

</div>

This item was deprecated in version 2020r2. Please use `Picture</api/graphics/picture>` as a replacement.

</div>

## Description

A pre-existing image that was either added to the project or is loaded from another source.

## Properties

<div class="rst-class">

table-centered_columns_3_and_4

</div>

| Name                      | Type                                                  | Read-Only | Shared |
|---------------------------|-------------------------------------------------------|-----------|--------|
| `Handle<iosimage.handle>` | `Ptr</api/data_types/additional_types/ptr>`           | ✓         |        |
| `Height<iosimage.height>` | `UInteger</api/data_types/additional_types/uinteger>` | ✓         |        |
| `Scale<iosimage.scale>`   | `Double</api/data_types/double>`                      | ✓         |        |
| `Width<iosimage.width>`   | `UInteger</api/data_types/additional_types/uinteger>` | ✓         |        |

## Methods

<div class="rst-class">

table-centered_column_4

</div>

| Name                                | Parameters                                                                            | Returns                                  | Shared |
|-------------------------------------|---------------------------------------------------------------------------------------|------------------------------------------|--------|
| `ToData<iosimage.todata>`           | type As `String</api/data_types/string>`                                              | `MemoryBlock</api/language/memoryblock>` |        |
| `WriteToFile<iosimage.writetofile>` | file As `FolderItem</api/files/folderitem>`, type As `String</api/data_types/string>` |                                          |        |

## Property descriptions

<div id="iosimage.handle">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSImage.Handle

**Handle** As `Ptr</api/data_types/additional_types/ptr>`

The UIImage handle to use when calling OS APIs through Declares.

This property is read-only.

<div id="iosimage.height">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSImage.Height

**Height** As `UInteger</api/data_types/additional_types/uinteger>`

The height of the image.

This property is read-only.

<div id="iosimage.scale">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSImage.Scale

**Scale** As `Double</api/data_types/double>`

The scale of the image.

This property is read-only.

<div id="iosimage.width">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSImage.Width

**Width** As `UInteger</api/data_types/additional_types/uinteger>`

The width of the image.

This property is read-only.

## Method descriptions

<div id="iosimage.todata">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSImage.ToData

**ToData**(type As `String</api/data_types/string>`) As `MemoryBlock</api/language/memoryblock>`

Converts the image to data that can be used for storing in databases, for example. Use type to specify the uniform type identifier for the data. For example, use "public.png" for PNG data.

Common types include "public.jpeg", "public.tiff" and "public.png".

Apple provides a list of [uniform type identifiers](https://developer.apple.com/library/mac/documentation/Miscellaneous/Reference/UTIRef/Articles/System-DeclaredUniformTypeIdentifiers.html).

<div id="iosimage.writetofile">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSImage.WriteToFile

**WriteToFile**(file As `FolderItem</api/files/folderitem>`, type As `String</api/data_types/string>`)

Writes the image to a file. Use type to specify the uniform type identifier for the data. For example, use "public.png" for PNG data.

Common types include "public.jpeg", "public.tiff" and "public.png".

Apple provides a list of [uniform type identifiers.](https://developer.apple.com/library/mac/documentation/Miscellaneous/Reference/UTIRef/Articles/System-DeclaredUniformTypeIdentifiers.html)

Save an image as a PNG file:

``` xojo
Var saveFile As Xojo.IO.FolderItem
saveFile = Xojo.IO.SpecialFolder.Documents.Child("MyImage.png")
myImage.WriteToFile(saveFile, "public.png")
```

## Notes

An <span class="title-ref">iOSImage</span> is immutable, which means that it cannot be changed. Because of this it can be cached by iOS for speed. If you need to change an image, you should instead create it as an `Picture</api/graphics/picture>`.

## Compatibility

iOS projects on the iOS operating system.

## See also

`Object</api/data_types/additional_types/object>` parent class; `Picture</api/graphics/picture>`, `iOSGraphics</api/deprecated/iosgraphics>`, `MobileImageViewer</api/user_interface/mobile/mobileimageviewer>` classes
