PictureType 属性 (权限)CommandButton.PictureType property (Access)

图片类型 属性用于指定 Microsoft Access 存储对象的图片作为链接或嵌入的对象。You can use the PictureType property to specify whether Microsoft Access stores an object's picture as a linked or an embedded object. 可读/写 Byte 类型。Read/write Byte.

语法Syntax

表达式PictureTypeexpression.PictureType

_表达式_一个代表**命令按钮** 对象的变量。expression A variable that represents a CommandButton object.

说明Remarks

PictureType 属性使用下列设置。The PictureType property uses the following settings.

设置Setting 说明Description
00 (默认值)图片嵌入到对象中成为数据库文件的一部分。(Default) The picture is embedded in the object and becomes part of the database file.
11 图片链接到对象中。The picture is linked to the object. Microsoft Access 存储的是指向图片在磁盘上所在位置的指针。Microsoft Access stores a pointer to the location of the picture on the disk.

此属性只能在窗体设计视图或报表设计视图中进行设置。This property can be set only in form Design view or report Design view.

对于控件, 可以使用默认控件样式或 Visual Basic 中的**DefaultControl** 属性来设置此属性的默认值。For controls, you can set the default for this property by using the default control style or the DefaultControl property in Visual Basic.

如果将此属性设置为“0”,则数据库大小会增加图片文件的大小,而且对于某些 .wmf 文件,数据库的大小可能增加图片文件大小的两倍。When this property is set to 0, the size of the database increases by the size of the picture file and, with some .wmf files, the size may increase as much as twice the size of the picture file. 如果将此属性设置为"1",则数据库大小不会增加,因为 Microsoft Access 仅保存一个指向磁盘中图片存储位置的指针。When this property is set to 1, there is no increase in the size of the database because Microsoft Access only saves a pointer to the picture's location on the disk.

备注

[!注释] 如果链接的文件被移动到其他位置的磁盘上,则必须使用对象的 Picture 属性来重新建立链接。If a linked file is moved to another location on the disk, you must re-establish the link by using the object's Picture property.

对于嵌入的图片对象的 PictureData 属性存储组成图片的单个位。For embedded pictures, the object's PictureData property stores the individual bits that make up a picture's image. 对于链接图片,此属性存储的图片文件的路径。For linked pictures, this property stores the path to the picture's file.

您可以使用单独的应用程序修改链接的图片, 下次在数据库中显示包含该图片的对象时, 图片的更改将会显示。You can modify a linked picture by using a separate application, and changes to the picture will appear the next time the object containing that picture is displayed in the database.

示例Example

下面的示例将 "订单输入" 窗体上 "客户照片图像" 控件中的图片链接到磁盘上的图片。The following example links the picture in the Customer Photo image control on the Order Entry form to the picture on the disk. 该图片不是数据库文件的一部分。The picture is not part of the database file.

Forms("Order Entry").Controls("Customer Photo").PictureType = 1 

支持和反馈Support and feedback

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.