PictureFormat.ImageFormat 属性 (Publisher)

返回一个 PbImageFormat 常量,该常量代表由 Microsoft Windows 图形设备接口 (GDI+) 确定的图像格式。 此为只读属性。

语法

表达式ImageFormat

表达 一个代表 PictureFormat 对象的变量。

返回值

PbImageFormat

备注

ImageFormat 属性应用到原始图片,而不是占位符图片,如果有的话。

ImageFormat 属性值可以是在 Microsoft 发布服务器类型库声明的 PbImageFormat 常量之一。

ImageFormat 属性指示后它已导入到 Windows 环境中,图片的格式,而不是其原始文件格式。 如果 Windows 操作系统本身不支持图片的文件格式,则图片将转换为本地所支持的相似格式。 因此, pbImageFormatCMYKJPEGpbImageFormatDIBpbImageFormatEMFpbImageFormatGIFpbImageFormatPICT 常量将很少,如果以往任何时候都,返回。

有关特定文件格式转换,请参阅下表。

文件格式 返回的常量
.bmp、.dib、.gif、.pict pbImageFormatPNG
.emf、.eps、.epfs pbImageFormatWMF
CMYK .jfif, .jpeg, .jpg pbImageFormatJPEG

Windows GDI+ 是 Windows 操作系统和 Windows Server 操作系统的一部分,提供二维矢量图形、图像处理和版式。

示例

以下示例打印一份当前出版物中存在的 .jpg 和 .jpeg 图像列表。

Dim pgLoop As Page 
Dim shpLoop As Shape 
 
For Each pgLoop In ActiveDocument.Pages 
 For Each shpLoop In pgLoop.Shapes 
 
 If shpLoop.Type = pbPicture Or shpLoop.Type = pbLinkedPicture Then 
 
 With shpLoop.PictureFormat 
 If .IsEmpty = msoFalse Then 
 
 If .ImageFormat = pbImageFormatJPEG Then 
 Debug.Print .Filename 
 End If 
 
 End If 
 End With 
 
 End If 
 
 Next shpLoop 
Next pgLoop 

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。