Take measurements in mixed reality

You can use the Measure in MR control in your app to let users measure distance, area, and volume. During the measurement, you create two-dimensional and three-dimensional polygons that can be used to confirm how a certain-sized object would fit within a space.

The control creates a button in your app. When app users select the button, it shows a live camera feed of the device. App users can then identify a starting point and then individual points to measure from. The distances of measured segments are shown directly on the live camera feed.

Photo showing a corner between two construction walls being measured with a mobile device.

When the user exits the control, the measurements that were taken are captured in the Measurements and MeasurementsDetailed properties so they can be saved or stored.

Screenshots taken during the mixed reality experience are stored in the Photos property for viewing within the app.

Tip

The mixed-reality controls work best in well-lit environments with flat-textured surfaces. When establishing tracking, point the device at the surface you would like to track and slowly pan the device from right to left in broad arm motions. If tracking fails, exit and enter the mixed-reality view to reset the tracking and try again.

LIDAR-enabled devices will also result in better tracking.

Use the control

Insert the control into your app as you normally would for any other button control.

With an app open for editing in Power Apps Studio:

  1. Open the Insert tab.
  2. Expand Mixed reality.
  3. Select the control Measure in MR to place it in the center of the app screen, or drag and drop it to position it anywhere on the screen.

Select Measure in MR.

You can modify the control with many properties.

Properties

The following properties are on the control's Measure in MR pane on the Properties and Advanced tabs.

The Measure in MR pane.

Some properties are only available under More options in the Advanced tab on the Measure in MR pane.

Property Description Type Location
Unit of measurement What unit the measurements should be shown and returned in. Drop-down selection Properties (also in Advanced)
Measurement type What type of measurement the user can make, whether point-to-point distance, a complete area, or a three-dimensional volume (area plus height or depth). Drop-down selection Properties (also in Advanced)
Box Draw Lock captured measurements to rectangular shapes by specifying only a width and a depth. Boolean Properties (also in Advanced)
Expected Measurements (Items) Data source (table) that lists a predefined set of measurements that you want the user to capture during a single session. You can map the labels you want to use for each measurement by using the ItemsLabels property. Not applicable Properties (also in Advanced)
ItemsLabels A column in Items with the strings you want to use as the labels for the measurements you want users to capture. ColumnName Advanced
ItemsMeasurementType (Optional) A column in Items with strings that specify the measurement type overrides (distance, area, volume, freeform, or blank) for the measurements you want users to capture. ColumnName Advanced
ItemsBoxDraw (Optional) A column in Items that specifies the Box Draw overrides (true, false, or blank) for the measurements you want users to capture. ColumnName Advanced
Measurements Table describing the measured distances, volumes, and areas, composed of:
  • Label - String that identifies the given measurement
  • Id - Number that uniquely identifies this measurement
  • Units - String describing the base unit of this measurement
  • Height - Number representing the height of the captured volume, or 0 if not a completed volume or 2D area
  • Length - Number representing the total length of the perimeter or path of the measurement
  • BoundingWidth - Number representing minimum width in units that bounds the shape
  • BoundingDepth - Number representing the minimum depth in units that bounds the shape
  • Area - Number representing the estimated area of the enclosed shape in units squared
  • Volume - Number representing the estimated volume of the enclosed shape in units cubed
  • Segments - Table describing all segments in the given measurement object with the following properties:
    • Length - Number representing the total distance of a given segment in the given units of measure (for example, .52)
    • DirectionX - Number specifying the X direction of the segment in world space (for example, 0.5)
    • DirectionY - Number specifying the Y direction of the measurement in world space (typically 0)
    • DirectionZ - Number specifying the Z direction of the measurement in world space (for example, 0.5)
Table Not applicable (output property only)
Photos The photos captured during the mixed reality session.
  • ImageURI - String indicating the uniform resource identifier (URI) where the saved photo is stored.
  • MimeType - String describing the Multipurpose Internet Mail Extensions (MIME) type for the photo (always image/jpeg).
  • FileSize - Number describing size of the photo in bytes.
  • Label - String that identifies the measurement associated with this photo or "" if unassociated. This corresponds to the Label property in the returned Measurements Data Set.

  • You can upload the mixed-reality photos to OneDrive and show them in a gallery.
Not applicable Not applicable (output property only)
OnMixedRealitySelect Behavior that is triggered when exiting the MR experience with new results. Defined action Advanced
OnChange Behavior that is triggered when any property on the button is changed. Defined action Advanced

Additional properties

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.

Color – The color of text in a control.

DisplayMode – Whether the control allows user input (Edit), only displays data (View), or is disabled (Disabled).

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

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

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

FillColor – The background color of a control.

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

FontStyle – The style of the text in the control: None, Strikethrough, Underline, or Italic.

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

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

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.

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

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

PaddingBottom – The distance between text in a control and the bottom edge of that control.

PaddingLeft – The distance between text in a control and the left edge of that control.

PaddingRight – The distance between text in a control and the right edge of that control.

PaddingTop – The distance between text in a control and the top edge of that control.

PressedBorderColor – The color of a control's border when the user selects that control.

PressedColor – The color of text in a control when the user selects that control.

PressedFill – The background color of a control when the user selects that control.

TabIndex – Keyboard navigation order.

TextAlignment – The alignment of the text: Center, Left, Right, or Justify

Tooltip – Explanatory text that appears when the user hovers over a control.

VerticalAlign – The location of text on a control in relation to the vertical center of that control: Middle, Top, or Bottom.

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 (or the screen if there's no parent container).

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

Other mixed reality controls

See also

Create an app using the Measure in MR control