Takes a photo or loads images from the local device.

Description

With this control users can take photos or upload image files from their device and update the data source with this content. On a mobile device the user is presented with the device's choice dialog to choose between taking a photo or selecting one already available.

This control is a composite control, made up of two controls. Press or tap once to select the outer control that shows the image that has been loaded. Press or tap again to select the inner text box control.

Outer control properties

These properties apply to the outer control.

BorderColor – The color of a control's border.

BorderStyle – Whether a control's border is Solid, Dashed, Dotted, or None.

BorderThickness – The thickness of a control's border.

Disabled – Whether the user can interact with the control.

DisabledBorderColor – The color of a control's border if the control's Disabled property is set to true.

DisabledFill – The background color of a control if its Disabled property is set to true.

Error - If there is a problem uploading an image, this property will contain an appropriate error string.

Fill – The background color of a control.

Height – The distance between a control's top and bottom edges.

HoverBorderColor – The color of a control's border when the user keeps the mouse pointer on that control.

HoverFill – The background color of a control when the user keeps the mouse pointer on it.

Media – An identifier for the clip that an audio or video control plays.

OnSelect – How the app responds when the user taps or clicks a control.

PressedBorderColor – The color of a control's border when the user taps or clicks that control.

PressedFill – The background color of a control when the user taps or clicks that control.

Visible – Whether a control appears or is hidden.

Width – The distance between a control's left and right edges.

X – The distance between the left edge of a control and the left edge of its parent container (screen if no parent container).

Y – The distance between the top edge of a control and the top edge of the parent container (screen if no parent container).

Inner text properties

These properties apply to the inner text box control that by default says "Tap or click to add a picture". To select this inner control, press or tap the Add picture control once, and then again.

Align – The location of text in relation to the horizontal center of its control.

Color – The color of text in a control.

DisabledColor – The color of text in a control if its Disabled property is set to true.

Font – The name of the family of fonts in which text appears.

FontWeight – The weight of the text in a control: Bold, Semibold, Normal, or Lighter.

HoverColor – The color of the text in a control when the user keeps the mouse pointer on it.

Italic – Whether the text in a control is italic.

OnChange – How the app responds when the user changes the value of a control (for example, by adjusting a slider).

Padding – The distance between the text on an import or export button and the edges of that button.

PressedColor – The color of text in a control when the user taps or clicks that control.

Size – The font size of the text that appears on a control.

Strikethrough – Whether a line appears through the text that appears on a control.

Text – Text that appears on a control or that the user types into a control.

Underline – Whether a line appears under the text that appears on a control.

VerticalAlign – The location of text on a control in relation to the vertical center of that control.

Related functions

Patch( DataSource, BaseRecord, ChangeRecord )

Example

Add images to an Image gallery control

  1. Add an Add picture control, and then triple-click it.

    Don't know how to add, name, and configure a control?

  2. In the Open dialog box, click or tap an image file, and then click or tap Open.

  3. Add a Button control, move it under the Add picture control, and set the OnSelect property for the Button control to this formula:
    Collect(MyPix, AddMediaButton1.Media)

    Want more information about the Collect function or other functions?

  4. Add an Image gallery control, and set its Items property to MyPix.

  5. Press F5, and then click or tap the Button control.

    The image from the Add picture control appears in the Image gallery control. If your image doesn't have the same aspect ratio as the Image control in the Image gallery control, set the ImagePosition property of the Image control to Fit.

  6. Click or tap the Add picture control, click or tap another image file, click or tap Open, and then click or tap the Button control that you added.

    The second image appears in the Image gallery control.

  7. (optional) Repeat the previous step one or more times, and then return to the default workspace by pressing Esc.

Use the SaveData function to save the images locally or the Patch function to update a data source.