Class

MobileImageViewer


Description

Displays an image.

Events

Name

Parameters

Returns

Closing

Opening

Enumerations

MobileImageViewer.DisplayModes

DisplayModes

The various ways in which the image can be displayed inside the control.

Enum

Description

ScaleToFill

The image's aspect ratio is ignored and the image is stretched to fit within the bounds of the frame.

ScaleAspectFit

Scales the image until it fits entirely, maintaining aspect.

ScaleAspectFill

Scales the image until it fills the ImageView entirely, maintaining aspect.

Center

The image is centered within the frame.

Top

The image is positioned with its top at the top of the frame.

Bottom

The image is positioned with its bottom at the bottom of the frame.

Left

The image is positioned with its left at the left of the frame.

Right

The image is positioned with its right at the right of the frame.

TopLeft

The image is positioned with its top left at the top left of the frame.

TopRight

The image is positioned with its top right at the top right of the frame.

BottomLeft

The image is positioned with its bottom left at the bottom left of the frame.

BottomRight

The image is positioned with its bottom right at the bottom right of the frame.

Property descriptions


MobileImageViewer.AccessibilityHint

AccessibilityHint As String

The accessibility hint is a longer description that is read aloud when VoiceOver is enabled.

Me.AccessibilityHint = "Click to calculate the value and display the next screen."

MobileImageViewer.AccessibilityLabel

AccessibilityLabel As String

The accessibility label of of a control is a short name that is read aloud when VoiceOver is enabled.

Me.AccessibilityLabel = "Calculate the value."

MobileImageViewer.ControlCount

ControlCount As Integer

The number of child controls in the control.

This property is read-only.


MobileImageViewer.DisplayMode

DisplayMode As DisplayModes

Specifies the way the picture gets displayed using the DisplayModes enumeration.

Center the image within the frame:

Me.DisplayMode = MobileImageViewer.DisplayModes.Center

MobileImageViewer.Enabled

Enabled As Boolean

Indicates whether the control is enabled or disabled.

Disable the button:

Button1.Enabled = False

MobileImageViewer.Height

Height As Double

The height of the control.

This property is read-only.


MobileImageViewer.Image

Image As Picture

The image to display.

Display an image in the project:

Me.Image = MyCompanyLogo

MobileImageViewer.Left

Left As Double

The left position of the control.

This property is read-only.


MobileImageViewer.Name

Name As String

The name of the control.


MobileImageViewer.Parent

Parent As MobileUIControl

The parent (sometimes called a "Super") class of the control.

This property is read-only.


MobileImageViewer.TintColor

TintColor As ColorGroup

Changes a control's tint color.

On iOS, the following controls support TintColor:

Enum

Description

ProgressBar

The area indicating the value of the control will be drawn in the TintColor.

Slider

The area indicating the value of the control will be drawn in the TintColor.

TextArea

The cursor and text highlight color will be drawn in the TintColor.

TextField

The cursor and text highlight color will be drawn in the TintColor.


MobileImageViewer.Top

Top As Double

The top position of the control.

This property is read-only.


MobileImageViewer.Visible

Visible As Boolean

Indicates whether the control is visible.

Make a button invisible:

Button1.Visible = False

MobileImageViewer.Width

Width As Double

The width of the control.

This property is read-only.

Method descriptions


MobileImageViewer.AddConstraint

AddConstraint(constraint As iOSLayoutConstraint)

Adds a constraint to the control.

This constraint is used by child controls that have been added to this control.


MobileImageViewer.AddControl

AddControl(child As MobileUIControl)

Adds a child control to the control.


MobileImageViewer.ClearFocus

ClearFocus

Removes the focus from the control.

TextField1.ClearFocus

MobileImageViewer.ControlAt

ControlAt(index As Integer) As MobileUIControl

Gets the child control at the specified index.


MobileImageViewer.Controls

Controls As Iterable

Allows you to iterate through all the controls that have been added to this control.


MobileImageViewer.Handle

Handle As Ptr

The a handle to the underlying native OS control.


MobileImageViewer.Refresh

Refresh

Marks the control so that it will be redrawn during the next event loop.

Call Refresh to force a Canvas to redraw itself:

Canvas1.Refresh

MobileImageViewer.RemoveConstraint

RemoveConstraint(constraint As iOSLayoutConstraint)

Removes a constraint from the control.


MobileImageViewer.RemoveControl

RemoveControl(child As MobileUIControl)

Removes the control from the control.


MobileImageViewer.SetFocus

SetFocus

Sets the focus to the control.

TextField1.SetFocus

Event descriptions


MobileImageViewer.Closing

Closing

Called when the control's layout is closing.


MobileImageViewer.Opening

Opening

Called when the control's layout is opening.

This is where you typically put initialization code.

This example in the Opening event of a label sets its text to "Hello":

Me.Text = "Hello"

Sample code

This code is executed from the Opening Event Handler in the default "Screen1" MobileScreen. It sets the DisplayMode and sets the image to one from the project (AppleImage).

ImageViewer1.DisplayMode = MobileImageViewer.DisplayModes.ScaleAspectFit // Set how the image will be displayed
ImageViewer1.Image = AppleImage

Compatibility

Mobile projects on all supported mobile operating systems.

See also

MobileUIControl parent class; Picture class