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.
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:
- Open the Insert tab.
- Expand Mixed reality.
- 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.
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.
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:
|
Table | Not applicable (output property only) |
| Photos | The photos captured during the mixed reality session.
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
- View 3D content with the View in 3D control.
- View images and 3D content in the real world with the View in mixed reality control.
- Create and view predefined 3D shapes with the View shape in mixed reality control