Table of contents
TOC
折叠目录
展开目录

GradientStops.Insert 方法 (办公室)GradientStops.Insert Method (Office)

office 365 dev account|上次更新日期: 2018/3/13
|
2 参与人员

向渐变添加一个光圈。Adds a stop to a gradient.

语法Syntax

表达式插入RGB位置透明度索引expression. Insert( RGB, Position, Transparency, Index )

表达式_该表达式返回一个GradientStops对象。_expression An expression that returns a GradientStops object.

参数Parameters

名称Name必需/可选Required/Optional数据类型Data Type说明Description
RGBRGB必需RequiredMsoRGBTypeMsoRGBType指定渐变光圈处的颜色。Specifies the color at the gradient stop.
PositionPosition必需Required一个Single以百分比形式指定渐变内部的光圈的位置。Specifies the position of the stop within the gradient expressed as a percent.
透明度Transparency可选Optional一个Single指定渐变光圈处的颜色不透明度。Specifies the opacity of color at the gradient stop.
IndexIndex可选OptionalLongLong光圈的索引号。The index number of the stop.

注解Remarks

渐变是指从一种颜色状态到另一种颜色状态的平缓过渡。这些部分的端点称为光圈。Gradients are a smooth transition from one color state to another. The endpoints of these sections are called stops.

示例Example

下面的示例在 Microsoft PowerPoint 中创建三个颜色渐变光圈。The following example creates three color gradient stops in Microsoft PowerPoint.

Sub gradients() 
 Set myDocument = ActivePresentation.Slides(1) 
 Set GradientShapeFill = myDocument.Shapes.AddShape(msoShapeRectangle, 90, 90, 90, 80).Fill 
 With GradientShapeFill 
 .ForeColor.RGB = RGB(0, 128, 128) 
 .OneColorGradient msoGradientHorizontal, 1, 1 
 .GradientStops.Insert RGB(255, 0, 0), 0.25 
 .GradientStops.Insert RGB(0, 255, 0), 0.5 
 .GradientStops.Insert RGB(0, 0, 255), 0.75 
 End With 
End Sub 

另请参阅See also

概念Concepts

GradientStops 对象GradientStops Object

其他资源Other resources

GradientStops 对象成员GradientStops Object Members

© 2018 Microsoft