Class

iOSImage


Warning

This item was deprecated in version 2020r2. Please use Picture as a replacement.

Description

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

Properties

Name

Type

Read-Only

Shared

Handle

Ptr

Height

UInteger

Scale

Double

Width

UInteger

Methods

Name

Parameters

Returns

Shared

ToData

type As String

MemoryBlock

WriteToFile

file As FolderItem, type As String

Property descriptions


iOSImage.Handle

Handle As Ptr

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

This property is read-only.


iOSImage.Height

Height As UInteger

The height of the image.

This property is read-only.


iOSImage.Scale

Scale As Double

The scale of the image.

This property is read-only.


iOSImage.Width

Width As UInteger

The width of the image.

This property is read-only.

Method descriptions


iOSImage.ToData

ToData(type As String) As 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.


iOSImage.WriteToFile

WriteToFile(file As FolderItem, type As 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.

Save an image as a PNG file:

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

Notes

An iOSImage 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.

Compatibility

iOS projects on the iOS operating system.

See also

Object parent class; Picture, iOSGraphics, MobileImageViewer classes