Google uses AI technology to translate content into your preferred language. AI translations can contain errors.
Class PictureFill
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
PictureFill
一种填充,用于渲染拉伸到容器尺寸的图片。
详细文档
getAs(contentType)
以转换为指定内容类型的 blob 形式返回此对象内的数据。
参数
| 名称 | 类型 | 说明 |
contentType | String | 要转换成的 MIME 类型。 |
返回
Blob - 以 blob 形式呈现的数据。
getBlob()
以转换后的 blob 形式返回此对象内的数据。
返回
Blob - 以 blob 形式呈现的数据。
getContentUrl()
获取指向图片的网址。
此网址会标记请求者的账号,因此拥有此网址的任何人都可以有效访问图片,就像原始请求者一样。如果演示文稿的共享设置发生变化,您可能无法再访问相应图片。该网址会在短时间后过期。
返回
String
授权
使用此方法的脚本需要获得以下一项或多项范围的授权:
-
https://www.googleapis.com/auth/presentations.currentonly
-
https://www.googleapis.com/auth/presentations
getSourceUrl()
获取图片的来源网址(如果有)。
当通过网址插入图片时,返回图片插入期间提供的网址。
返回
String|null - 图片网址,如果图片没有来源网址,则为 null。
授权
使用此方法的脚本需要获得以下一项或多项范围的授权:
-
https://www.googleapis.com/auth/presentations.currentonly
-
https://www.googleapis.com/auth/presentations
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2026-04-13。
[null,null,["最后更新时间 (UTC):2026-04-13。"],[],["PictureFill renders an image stretched to its container's dimensions. Key actions include: `getAs(contentType)` returning blob data converted to a specified type, with filename adjustments; `getBlob()` returning data as a blob; `getContentUrl()` retrieving a URL to the image, expiring after a short time and tied to the requester's account. Lastly, `getSourceUrl()` fetches the original image's source URL, if available, otherwise returning null. These method are accessible if authorized by the correct scopes.\n"]]