PowerApps 中的图像控件Image control in PowerApps

显示来自本地文件或数据源等来源的图像的控件。A control that shows an image from, for example, a local file or a data source.

说明Description

如果向应用添加了一个或多个图像控件,则可以显示不属于数据集的单个图像,也可以合并数据源中的记录的图像。If you add one or more Image controls to your app, you can show individual images that aren't part of a data set, or you can incorporate images from records in data sources.

关键属性Key properties

Image – 在图像、音频或麦克风控件中显示的图像名称。Image – The name of the image that appears in an image, audio, or microphone control.

其他属性Additional properties

ApplyEXIFOrientation - 是否自动应用随图像一起嵌入的 EXIF 数据中指定的方向。ApplyEXIFOrientation – Whether to automatically apply the orientation specified in the EXIF data embedded with the image.

AutoDisableOnSelect – 在执行 OnSelect 行为时自动禁用控件。AutoDisableOnSelect – Automatically disables the control while the OnSelect behavior is executing.

BorderColor – 控件边框的颜色。BorderColor – The color of a control's border.

BorderStyle – 控件边框是实线虚线点线还是BorderStyle – Whether a control's border is Solid, Dashed, Dotted, or None.

BorderThickness – 控件边框的粗细。BorderThickness – The thickness of a control's border.

FocusedBorderThickness – 控件具有键盘焦点时的边框粗细。FocusedBorderThickness – The thickness of the control's border when it has keyboard focus.

CalculateOriginalDimensions – 启用 OriginalHeightOriginalWidth 属性。CalculateOriginalDimensions – Enables the OriginalHeight and OriginalWidth properties.

DisplayMode – 此控件是允许用户输入 (Edit)、仅显示数据 (View),还是已禁用 (Disabled)。DisplayMode – Whether the control allows user input (Edit), only displays data (View), or is disabled (Disabled).

DisabledBorderColor – 控件的 DisplayMode 属性设置为 Disabled 时,该控件边框的颜色。DisabledBorderColor – The color of a control's border if the control's DisplayMode property is set to Disabled.

DisabledFill – 控件的 DisplayMode 属性设置为 Disabled 时,该控件的背景颜色。DisabledFill – The background color of a control if its DisplayMode property is set to Disabled.

Fill – 控件的背景颜色。Fill – The background color of a control.

FlipHorizontal - 是否在显示前先水平翻转图像。FlipHorizontal – Whether to flip the image horizontally before displaying it.

FlipVertical - 是否在显示前先垂直翻转图像。FlipVertical – Whether to flip the image vertically before displaying it.

Height – 控件上边缘和下边缘之间的距离。Height – The distance between a control's top and bottom edges.

HoverBorderColor – 用户将鼠标指针停留在控件上时,该控件边框的颜色。HoverBorderColor – The color of a control's border when the user keeps the mouse pointer on that control.

HoverFill – 用户将鼠标指针停留在控件上时,该控件的背景颜色。HoverFill – The background color of a control when the user keeps the mouse pointer on it.

ImagePosition – 屏幕或控件大小与图像大小不同时,其中图像的位置(“填充”、“适应”、“拉伸”、“平铺”或“居中”)。ImagePosition – The position (Fill, Fit, Stretch, Tile, or Center) of an image in a screen or a control if it isn't the same size as the image.

ImageRotation - 如何在显示前旋转图像。ImageRotation – How to rotate the image before displaying it. 值可以是不旋转、顺时针 (CW) 旋转 90 度、逆时针 (CCW) 旋转 90 度和顺时针旋转 180 度。Values can be none, clockwise (CW) 90 degrees, counter-clockwise (CCW) 90 degrees and clockwise 180 degrees.

OnSelect – 用户点击或单击某个控件时应用响应的方式。OnSelect – How the app responds when the user taps or clicks a control.

OriginalHeight – 使用 CalculateOriginalDimensions 属性启用的图像的原始高度。OriginalHeight – Original height of an image, enabled with the CalculateOriginalDimensions property.

OriginalWidth – 使用 CalculateOriginalDimensions 属性启用的图像的原始宽度。OriginalWidth – Original width of an image, enabled with the CalculateOriginalDimensions property.

PaddingBottom - 控件中的文本与该控件的下边缘之间的距离。PaddingBottom – The distance between text in a control and the bottom edge of that control.

PaddingLeft - 控件中的文本与该控件的左边缘之间的距离。PaddingLeft – The distance between text in a control and the left edge of that control.

PaddingRight - 控件中的文本与该控件的右边缘之间的距离。PaddingRight – The distance between text in a control and the right edge of that control.

PaddingTop - 控件中的文本与该控件的上边缘之间的距离。PaddingTop – The distance between text in a control and the top edge of that control.

PressedBorderColor – 用户在点击或单击控件时,该控件边框的颜色。PressedBorderColor – The color of a control's border when the user taps or clicks that control.

PressedFill – 用户在点击或单击控件时,该控件的背景色。PressedFill – The background color of a control when the user taps or clicks that control.

RadiusBottomLeft – 控件左下角圆角的程度。RadiusBottomLeft – The degree to which the bottom-left corner of a control is rounded.

RadiusBottomRight – 控件右下角圆角的程度。RadiusBottomRight – The degree to which the bottom-right corner of a control is rounded.

RadiusTopLeft – 控件左上角圆角的程度。RadiusTopLeft – The degree to which the top-left corner of a control is rounded.

RadiusTopRight – 控件右上角圆角的程度。RadiusTopRight – The degree to which the top-right corner of a control is rounded.

Tooltip – 用户将鼠标悬停在控件上时显示的解释性文本。Tooltip – Explanatory text that appears when the user hovers over a control.

Transparency – 图像后的控件仍然可见的程度。Transparency – The degree to which controls behind an image remain visible.

Visible – 控件显示还是隐藏。Visible – Whether a control appears or is hidden.

Width – 控件左边缘和右边缘之间的距离。Width – The distance between a control's left and right edges.

X - 控件左边缘与其父容器(如果没有父容器,则为屏幕)左边缘之间的距离。X – The distance between the left edge of a control and the left edge of its parent container (screen if no parent container).

Y - 控件上边缘与其父容器(如果没有父容器,则为屏幕)上边缘之间的距离。Y – The distance between the top edge of a control and the top edge of the parent container (screen if no parent container).

Remove( DataSource, ThisItem )Remove( DataSource, ThisItem )

示例Examples

显示来自本地文件的图像Show an image from a local file

  1. 在“内容”选项卡上,单击或点击“媒体”,然后单击或点击“浏览”。On the Content tab, click or tap Media, and then click or tap Browse.
  2. 单击或点击要添加的图像文件,然后单击或点击“打开”,按 Esc 返回到默认工作区。Click or tap the image file that you want to add, click or tap Open, and then press Esc to return to the default workspace.
  3. 添加图像控件,并将其 Items 属性设置为你添加的文件的名称。Add an Image control, and set its Items property to the name of the file that you added.

    不知道如何添加和配置控件Don't know how to add and configure a control?

    图像控件显示你指定的图像。The Image control shows the image that you specified.

显示一组数据源的图像Show a set of images from a data source

  1. 下载此 Excel 文件,并将其保存在本地设备上。Download this Excel file, and save it on your local device.
  2. 在 PowerApps Studio 中,创建或打开应用,再单击或点击右侧窗格中的“添加数据源”。In PowerApps Studio, create or open an app, and then click or tap Add data source in the right-hand pane.

    如果右侧窗格未显示“添加数据源”选项卡,请单击或点击左侧导航栏中的任意屏幕。If Add data source doesn't appear in the right-hand pane, click or tap a screen in the left navigation bar.

  3. 单击或点击“将静态数据添加到应用”,单击或点击已下载的 Excel 文件,然后单击或点击“打开”。Click or tap Add static data to your app, click or tap the Excel file that you downloaded, and then click or tap Open.
  4. 选择“地板估计”复选框,然后单击或点击“连接”。Select the Flooring Estimates check box, and then click or tap Connect.
  5. 添加带图像的“库”控件,并将“Items”属性设置为“FlooringEstimates”。Add a Gallery control with images, and set its Items property to FlooringEstimates.

    不知道如何添加和配置控件Don't know how to add and configure a control?

    “库”控件根据所下载的 Excel 文件中的链接显示地毯、硬木和地砖产品的图像。The Gallery control shows images of carpet, hardwood, and tile products based on links in the Excel file that you downloaded.