Skip to content

Paint

A description of the style to use when drawing a shape on the canvas.

属性 ​

名称类型默认值说明
colorColorValueColors.BLACKThe color to use when stroking or filling a shape.
blend_modeBlendModeBlendMode.SRC_OVERA blend mode to apply when a shape is drawn or a layer is composited.
blur_imageOptional[BlurValue]NoneBlur image when drawing it on a canvas.
anti_aliasboolTrueWhether to apply anti-aliasing to lines and images drawn on the canvas.
gradientOptional[PaintGradient]NoneConfigures gradient paint.
stroke_capStrokeCapStrokeCap.BUTTThe kind of finish to place on the ends of stroked lines. This applies when style is STROKE.
stroke_joinStrokeJoinStrokeJoin.MITERThe kind of finish to place on joins between stroked segments. This applies when style is STROKE. See also: stroke_miter_limit
stroke_miter_limitNumber4.0The limit for drawing miter joins when stroke_join is MITER and style is STROKE. If this limit is exceeded, a bevel join is used instead.
stroke_widthNumber0.0How wide stroked edges should be, in logical pixels. This applies when style is STROKE. A width of 0.0 corresponds to a hairline.
stroke_dash_patternOptional[list[Number]]NoneDash pattern used when painting stroked outlines. Values alternate between painted dash lengths and unpainted gap lengths. For example, [5, 10] paints a dash 5 logical pixels long, then leaves a gap 10 logical pixels long, repeating the pattern along the stroked path. Note: This applies only when style is STROKE.
stylePaintingStylePaintingStyle.FILLWhether to paint filled interiors or only stroked outlines.

方法 ​

名称类型默认值说明
copy'Paint'—返回此对象的副本,可覆盖指定属性。

关注我,学习大模型、大数据、Python等热门技术。