我正在尝试为我创建的矩形自动形状的边框添加颜色,如下所示。默认颜色似乎是蓝色,但我不确定如何将其修改为自定义颜色。
shapes = slide.shapes
left = top = width = height = Inches(1.0)
shape = shapes.add_shape(
MSO_SHAPE.ROUNDED_RECTANGLE, left, top, width, height)
fill = shape.fill
fill.solid()
fill.fore_color.rgb = RGBColor(255, 255, 255)
slide.shapes._spTree.remove(shape._element)
slide.shapes._spTree.insert(2, shape._element)
Run Code Online (Sandbox Code Playgroud)
弄清楚如何使用以下方法更改自动形状边框颜色:
line = shape.line
line.color.rgb = RGBColor(255, 0, 0)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1456 次 |
| 最近记录: |