How to control photo resolution and display size

This article pertains to those Formotus custom controls that capture images from the device's camera into a form.

Resolution vs. Display Size

Photo resolution and display size are two different things. The resolution of a photo is set at the time it is snapped into the form, and after that it never changes. The display size is determined by the properties of the picture control in the layout of the form. A high-resolution picture can be displayed in a small control, but a low-resolution picture will look blurry in too large a control.

The same photo can be shown in more than one control with different display sizes. For example, one view might display the photo large for printing while another view displays it as a small thumbnail. You can even copy an image from one field to another where it will be displayed at a different size, but none of this changes the underlying resolution (and file size) of the photo.

Photos are saved as base64 fields in the XML file that gets submitted. A high-resolution photo saves more data into the file than a low-resolution photo. This means you'll be able include more low-resolution photos in a form before you start hitting limits in terms of device processing power and bandwidth required for submissions.

Controlling the Display Size

The display size in the form is determined by the size properties of the InfoPath picture control inside the Formotus custom control section.

In order to keep the photo proportional no matter whether it's portrait or landscape, set one dimension in pixels and set the other to "auto". Typically you'll want to define the width and let the height vary depending on the photo's orientation.

Controlling the Photo Resolution

The manner in which the resolution is determined varies by platform.

On iOS the resolution is dictated by the size of the picture control in the layout of the form. The larger the control used to capture the photo, the higher the photo resolution.

On Android the resolution (in pixels) is chosen by the user in the view finder before snapping the photo.

On Windows the resolution is fixed and cannot be changed by the user.

 

Have more questions? Submit a request

1 Comments

  • 0
    Avatar
    Andrew Barolo

    Excellent post!

Please sign in to leave a comment.