Table of contents
TOC
折叠目录
展开目录

Image.ImageHeight 属性 (访问)Image.ImageHeight Property (Access)

office 365 dev account|上次更新日期: 2018/3/13
|
2 参与人员

您可以使用ImageHeight属性确定以缇为单位的图像控件中图片的高度。读/写You can use the ImageHeight property to determine the height in twips of the picture in an image control. Read/write Long.

语法Syntax

表达式ImageHeightexpression. ImageHeight

表达式_一个表示图像对象的变量。_expression A variable that represents an Image object.

注解Remarks

该属性在所有视图中都是只读的。This property is read-only in all views.

ImageHeight属性和ImageWidth属性可用于确定图像控件中图片的大小。然后可以使用此信息来更改图像控件的高度宽度属性来匹配显示的图片的大小。You can use the ImageHeight property together with the ImageWidth property to determine the size of a picture in an image control. You could then use this information to change the image control's Height and Width properties to match the size of the picture displayed.

示例Example

下面的示例提示用户输入名称的一个位图,然后将该位图分配给 Image1 图像控件的Picture属性。ImageHeightImageWidth属性用于调整图像控件来调整位图的大小。The following example prompts the user to enter the name of a bitmap and then assigns that bitmap to the Picture property of the Image1 image control. The ImageHeight and ImageWidth properties are used to resize the image control to fit the size of the bitmap.

Sub GetNewPicture(frm As Form) 
    Dim ctlImage As Control 
    Set ctlImage = frm!Image1 
    ctlImage.Picture = InputBox("Enter path and " _ 
        &; "file name for new bitmap") 
    ctlImage.Height = ctlImage.ImageHeight 
    ctlImage.Width = ctlImage.ImageWidth 
End Sub

另请参阅See also

概念Concepts

图像对象Image Object

© 2018 Microsoft