主题
DecorationImage
An image for a box decoration.
属性
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
src | Optional[Union[str, bytes]] | None | The image source to paint. Accepts URLs, asset paths, base64 strings (with or without data: prefixes), or raw bytes. |
color_filter | Optional[ColorFilter] | None | A color filter to apply to the image before painting it. |
fit | Optional[BoxFit] | None | How the image should be inscribed into the box. |
alignment | Alignment | Alignment.CENTER() | The alignment of the image within its bounds. |
repeat | ImageRepeat | ImageRepeat.NO_REPEAT | How the image should be repeated to fill the box. |
match_text_direction | bool | False | Whether to paint the image in the direction of the TextDirection. |
scale | Number | 1.0 | The scale(image pixels to be shown per logical pixels) to apply to the image. |
opacity | Number | 1.0 | The opacity of the image. |
filter_quality | FilterQuality | FilterQuality.MEDIUM | The quality of the image filter. |
invert_colors | bool | False | Whether to invert the colors of the image while drawing. |
anti_alias | bool | False | Whether to paint the image in anti-aliased quality. |
方法
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
copy | 'DecorationImage' | — | 返回此对象的副本,可覆盖指定属性。 |