Interface IGradientStop
Represents a gradient stop in the IGradientFill object.
Namespace: Syncfusion.Presentation
Assembly: Syncfusion.Presentation.Portable.dll
Syntax
public interface IGradientStop
Properties
Brightness
Gets the brightness of the gradient stop. Read-only.
Declaration
float Brightness { get; }
Property Value
Type |
---|
System.Single |
Examples
//Create a new presentation.
IPresentation presentation = Presentation.Create();
//Add a slide to the presentation.
ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
//Set gradient fill to the slide background
slide.Background.Fill.FillType = FillType.Gradient;
//Create instance for gradient stop - 1
IGradientStop gradStop = slide.Background.Fill.GradientFill.GradientStops.Add();
//Set position for gradient stop
gradStop.Position = 2.4F;
//Set color for gradient stop
gradStop.Color = ColorObject.FromArgb(23, 156, 90);
//Create instance for gradient stop - 2
IGradientStop _gradStop = slide.Background.Fill.GradientFill.GradientStops.Add();
//Set position for gradient stop
_gradStop.Position = 5F;
//Set color for gradient stop
_gradStop.Color = ColorObject.FromArgb(20, 106, 120);
//Get the brightness of gradient stop - read only.
float brightness = _gradStop.Brightness;
//Save the presentation
presentation.Save("Sample.pptx");
//Close the presentation
presentation.Close();
'Create a new presentation.
Dim presentation__1 As IPresentation = Presentation.Create()
'Add a slide to the presentation.
Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
'Set gradient fill to the slide background
slide.Background.Fill.FillType = FillType.Gradient
'Create instance for gradient stop - 1
Dim gradStop As IGradientStop = slide.Background.Fill.GradientFill.GradientStops.Add()
'Set position for gradient stop
gradStop.Position = 2.4F
'Set color for gradient stop
gradStop.Color = ColorObject.FromArgb(23, 156, 90)
'Create instance for gradient stop - 2
Dim _gradStop As IGradientStop = slide.Background.Fill.GradientFill.GradientStops.Add()
'Set position for gradient stop
_gradStop.Position = 5F
'Set color for gradient stop
_gradStop.Color = ColorObject.FromArgb(20, 106, 120)
'Get the brightness of gradient stop - read only.
Dim brightness As Single = _gradStop.Brightness
'Save the presentation
presentation__1.Save("Sample.pptx")
'Close the presentation
presentation__1.Close()
Color
Gets or sets the IColor structure for the gradient stop.
Declaration
IColor Color { get; set; }
Property Value
Type |
---|
IColor |
Examples
//Create a new presentation.
IPresentation presentation = Presentation.Create();
//Add a slide to the presentation.
ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
//Set gradient fill to the slide background
slide.Background.Fill.FillType = FillType.Gradient;
//Create instance for gradient stop - 1
IGradientStop gradStop = slide.Background.Fill.GradientFill.GradientStops.Add();
//Set position for gradient stop
gradStop.Position = 2.4F;
//Set color for gradient stop
gradStop.Color = ColorObject.FromArgb(23, 156, 90);
//Create instance for gradient stop - 2
IGradientStop _gradStop = slide.Background.Fill.GradientFill.GradientStops.Add();
//Set position for gradient stop
_gradStop.Position = 5F;
//Set color for gradient stop
_gradStop.Color = ColorObject.FromArgb(20, 106, 120);
//Save the presentation
presentation.Save("Sample.pptx");
//Close the presentation
presentation.Close();
'Create a new presentation.
Dim presentation__1 As IPresentation = Presentation.Create()
'Add a slide to the presentation.
Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
'Set gradient fill to the slide background
slide.Background.Fill.FillType = FillType.Gradient
'Create instance for gradient stop - 1
Dim gradStop As IGradientStop = slide.Background.Fill.GradientFill.GradientStops.Add()
'Set position for gradient stop
gradStop.Position = 2.4F
'Set color for gradient stop
gradStop.Color = ColorObject.FromArgb(23, 156, 90)
'Create instance for gradient stop - 2
Dim _gradStop As IGradientStop = slide.Background.Fill.GradientFill.GradientStops.Add()
'Set position for gradient stop
_gradStop.Position = 5F
'Set color for gradient stop
_gradStop.Color = ColorObject.FromArgb(20, 106, 120)
'Save the presentation
presentation__1.Save("Sample.pptx")
'Close the presentation
presentation__1.Close()
Position
Gets or sets the gradient stop position. The position ranges from 0 to 100.
Declaration
float Position { get; set; }
Property Value
Type |
---|
System.Single |
Examples
//Create a new presentation.
IPresentation presentation = Presentation.Create();
//Add a slide to the presentation.
ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
//Set gradient fill to the slide background
slide.Background.Fill.FillType = FillType.Gradient;
//Create instance for gradient stop - 1
IGradientStop gradStop = slide.Background.Fill.GradientFill.GradientStops.Add();
//Set position for gradient stop
gradStop.Position = 2.4F;
//Set color for gradient stop
gradStop.Color = ColorObject.FromArgb(23, 156, 90);
//Create instance for gradient stop - 2
IGradientStop _gradStop = slide.Background.Fill.GradientFill.GradientStops.Add();
//Set position for gradient stop
_gradStop.Position = 5F;
//Set color for gradient stop
_gradStop.Color = ColorObject.FromArgb(20, 106, 120);
//Save the presentation
presentation.Save("Sample.pptx");
//Close the presentation
presentation.Close();
'Create a new presentation
Dim presentation__1 As IPresentation = Presentation.Create()
'Add a slide to the presentation.
Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
'Set gradient fill to the slide background
slide.Background.Fill.FillType = FillType.Gradient
'Create instance for gradient stop - 1
Dim gradStop As IGradientStop = slide.Background.Fill.GradientFill.GradientStops.Add()
'Set position for gradient stop
gradStop.Position = 2.4F
'Set color for gradient stop
gradStop.Color = ColorObject.FromArgb(23, 156, 90)
'Create instance for gradient stop - 2
Dim _gradStop As IGradientStop = slide.Background.Fill.GradientFill.GradientStops.Add()
'Set position for gradient stop
_gradStop.Position = 5F
'Set color for gradient stop
_gradStop.Color = ColorObject.FromArgb(20, 106, 120)
'Save the presentation
presentation__1.Save("Sample.pptx")
'Close the presentation
presentation__1.Close()
Transparency
Gets or sets the transparency of the gradient stop. The value of the transparency ranges from 0 to 100.
Declaration
int Transparency { get; set; }
Property Value
Type |
---|
System.Int32 |
Examples
//Create a new presentation.
IPresentation presentation = Presentation.Create();
//Add a slide to the presentation.
ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
//Set gradient fill to the slide background
slide.Background.Fill.FillType = FillType.Gradient;
//Create instance for gradient stop - 1
IGradientStop gradStop = slide.Background.Fill.GradientFill.GradientStops.Add();
//Set position for gradient stop
gradStop.Position = 2.4F;
//Set color for gradient stop
gradStop.Color = ColorObject.FromArgb(23, 156, 90);
//Set transparency of gradient stop
gradStop.Transparency = 57;
//Create instance for gradient stop - 2
IGradientStop _gradStop = slide.Background.Fill.GradientFill.GradientStops.Add();
//Set position for gradient stop
_gradStop.Position = 5F;
//Set color for gradient stop
_gradStop.Color = ColorObject.FromArgb(20, 106, 120);
//Save the presentation
presentation.Save("Sample.pptx");
//Close the presentation
presentation.Close();
'Create a new presentation.
Dim presentation__1 As IPresentation = Presentation.Create()
'Add a slide to the presentation.
Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
'Set gradient fill to the slide background
slide.Background.Fill.FillType = FillType.Gradient
'Create instance for gradient stop - 1
Dim gradStop As IGradientStop = slide.Background.Fill.GradientFill.GradientStops.Add()
'Set position for gradient stop
gradStop.Position = 2.4F
'Set color for gradient stop
gradStop.Color = ColorObject.FromArgb(23, 156, 90)
'Set transparency of gradient stop
gradStop.Transparency = 57
'Create instance for gradient stop - 2
Dim _gradStop As IGradientStop = slide.Background.Fill.GradientFill.GradientStops.Add()
'Set position for gradient stop
_gradStop.Position = 5F
'Set color for gradient stop
_gradStop.Color = ColorObject.FromArgb(20, 106, 120)
'Save the presentation
presentation__1.Save("Sample.pptx")
'Close the presentation
presentation__1.Close()