描述网页的背景
方法
| 方法 | 返回类型 | 简介 |
|---|---|---|
get | Picture | 获取此背景的拉伸图片填充,如果背景填充类型不是 Page,则返回 null。 |
get | Solid | 获取此背景的纯色填充,如果背景填充类型不是 Page,则返回 null。 |
get | Page | 获取相应页面背景的类型。 |
is | Boolean | 背景是否可见。 |
set | void | 将指定图片 blob 中的图片设为网页背景。 |
set | void | 将指定网址处的图片设为网页背景。 |
set | void | 将纯色填充设置为给定的 Color。 |
set | void | 将纯色填充设置为指定的 Alpha 值和 Color。 |
set | void | 将纯色填充设置为指定的 RGB 值。 |
set | void | 将纯色填充设置为指定的 Alpha 和 RGB 值。 |
set | void | 将纯色填充设置为给定的十六进制颜色字符串。 |
set | void | 将纯色填充设置为给定的 Alpha 和十六进制颜色字符串。 |
set | void | 将纯色填充设置为给定的 Theme。 |
set | void | 将纯色填充设置为指定的 Alpha 值和 Theme。 |
set | void | 将背景设置为透明。 |
详细文档
getPictureFill()
获取此背景的拉伸图片填充,如果背景填充类型不是 PageBackgroundType.PICTURE,则返回 null。
返回
PictureFill|null
授权
使用此方法的脚本需要获得以下一项或多项范围的授权:
-
https://www.googleapis.com/auth/presentations.currentonly -
https://www.googleapis.com/auth/presentations
getSolidFill()
获取此背景的纯色填充,如果背景填充类型不是 PageBackgroundType.SOLID,则返回 null。
返回
SolidFill|null
授权
使用此方法的脚本需要获得以下一项或多项范围的授权:
-
https://www.googleapis.com/auth/presentations.currentonly -
https://www.googleapis.com/auth/presentations
getType()
获取相应页面背景的类型。
返回
授权
使用此方法的脚本需要获得以下一项或多项范围的授权:
-
https://www.googleapis.com/auth/presentations.currentonly -
https://www.googleapis.com/auth/presentations
isVisible()
背景是否可见。
返回
Boolean
授权
使用此方法的脚本需要获得以下一项或多项范围的授权:
-
https://www.googleapis.com/auth/presentations.currentonly -
https://www.googleapis.com/auth/presentations
setPictureFill(blobSource)
将指定图片 blob 中的图片设为网页背景。图片会拉伸以匹配页面的尺寸。
插入图片时,系统会从 BlobSource 中提取一次图片,并存储一份副本以在演示文稿中显示。图片大小必须小于 50MB,像素数不得超过 2500 万,且必须为 PNG、JPEG 或 GIF 格式。
参数
| 名称 | 类型 | 说明 |
|---|---|---|
blob | Blob | 图片数据。 |
授权
使用此方法的脚本需要获得以下一项或多项范围的授权:
-
https://www.googleapis.com/auth/presentations.currentonly -
https://www.googleapis.com/auth/presentations
setPictureFill(imageUrl)
将指定网址处的图片设为网页背景。图片会拉伸至与页面尺寸相匹配的尺寸。
插入图片时,系统会从相应网址获取图片一次,并存储一份副本以在演示中显示。图片大小不得超过 50MB,像素数不得超过 2500 万,且必须为 PNG、JPEG 或 GIF 格式。
所提供的网址必须可以公开访问,且大小不得超过 2kB。网址本身会与图片一起保存,并通过 PictureFill.getSourceUrl() 公开。
参数
| 名称 | 类型 | 说明 |
|---|---|---|
image | String | 用于下载图片的网址。 |
授权
使用此方法的脚本需要获得以下一项或多项范围的授权:
-
https://www.googleapis.com/auth/presentations.currentonly -
https://www.googleapis.com/auth/presentations
setSolidFill(color)
setSolidFill(color, alpha)
setSolidFill(red, green, blue)
将纯色填充设置为指定的 RGB 值。
参数
| 名称 | 类型 | 说明 |
|---|---|---|
red | Integer | 红色分量。 |
green | Integer | 绿色分量。 |
blue | Integer | 蓝色分量。 |
授权
使用此方法的脚本需要获得以下一项或多项范围的授权:
-
https://www.googleapis.com/auth/presentations.currentonly -
https://www.googleapis.com/auth/presentations
setSolidFill(red, green, blue, alpha)
将纯色填充设置为指定的 Alpha 和 RGB 值。
参数
| 名称 | 类型 | 说明 |
|---|---|---|
red | Integer | 红色分量。 |
green | Integer | 绿色分量。 |
blue | Integer | 蓝色分量。 |
alpha | Number | Alpha 值(透明度)。 |
授权
使用此方法的脚本需要获得以下一项或多项范围的授权:
-
https://www.googleapis.com/auth/presentations.currentonly -
https://www.googleapis.com/auth/presentations
setSolidFill(hexString)
将纯色填充设置为给定的十六进制颜色字符串。
参数
| 名称 | 类型 | 说明 |
|---|---|---|
hex | String | 十六进制颜色字符串。 |
授权
使用此方法的脚本需要获得以下一项或多项范围的授权:
-
https://www.googleapis.com/auth/presentations.currentonly -
https://www.googleapis.com/auth/presentations
setSolidFill(hexString, alpha)
将纯色填充设置为给定的 Alpha 和十六进制颜色字符串。
参数
| 名称 | 类型 | 说明 |
|---|---|---|
hex | String | 十六进制颜色字符串。 |
alpha | Number | Alpha 值(透明度)。 |
授权
使用此方法的脚本需要获得以下一项或多项范围的授权:
-
https://www.googleapis.com/auth/presentations.currentonly -
https://www.googleapis.com/auth/presentations
setSolidFill(color)
将纯色填充设置为给定的 ThemeColorType。
参数
| 名称 | 类型 | 说明 |
|---|---|---|
color | Theme | 主题颜色类型。 |
授权
使用此方法的脚本需要获得以下一项或多项范围的授权:
-
https://www.googleapis.com/auth/presentations.currentonly -
https://www.googleapis.com/auth/presentations
setSolidFill(color, alpha)
将纯色填充设置为指定的 Alpha 值和 ThemeColorType。
参数
| 名称 | 类型 | 说明 |
|---|---|---|
color | Theme | 主题颜色类型。 |
alpha | Number | Alpha 值(透明度)。 |
授权
使用此方法的脚本需要获得以下一项或多项范围的授权:
-
https://www.googleapis.com/auth/presentations.currentonly -
https://www.googleapis.com/auth/presentations
setTransparent()
将背景设置为透明。
授权
使用此方法的脚本需要获得以下一项或多项范围的授权:
-
https://www.googleapis.com/auth/presentations.currentonly -
https://www.googleapis.com/auth/presentations