menu

WinForms

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Interface IGradientFill - WindowsForms API Reference | Syncfusion

    Show / Hide Table of Contents

    Interface IGradientFill

    Represents the gradient type fill format.

    Namespace: Syncfusion.Presentation
    Assembly: Syncfusion.Presentation.Base.dll
    Syntax
    public interface IGradientFill

    Properties

    GradientStops

    Gets the gradient stop collection. Read-only.

    Declaration
    IGradientStops GradientStops { get; }
    Property Value
    Type
    IGradientStops
    Examples
    //Create a new presentation.
    IPresentation presentation = Presentation.Create();
    //Add a slide to the presentation.
    ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
    slide.Background.Fill.FillType = FillType.Gradient;
    //Retrieve the gradient fill from the shape
    IGradientFill gradientFill = slide.Background.Fill.GradientFill;
    //Add a gradient stop.
    gradientFill.GradientStops.Add();
    //Retrieve gradient stops, it is read only
    IGradientStops stops = gradientFill.GradientStops;
    //Add gradient stop with color 
    stops.Add().Color = ColorObject.FromArgb(13, 34, 89, 32);
    //Add gradient stop with position
    stops.Add().Position = 3.5F;
    //Save the presentation
    presentation.Save("Output.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)
    slide.Background.Fill.FillType = FillType.Gradient
    'Retrieve the gradient fill from the shape
    Dim gradientFill As IGradientFill = slide.Background.Fill.GradientFill
    'Add a gradient stop.
    gradientFill.GradientStops.Add()
    'Retrieve gradient stops, it is read only
    Dim stops As IGradientStops = gradientFill.GradientStops
    'Add gradient stop with color 
    stops.Add().Color = ColorObject.FromArgb(13, 34, 89, 32)
    'Add gradient stop with position
    stops.Add().Position = 3.5F
    'Save the presentation
    presentation__1.Save("Output.pptx")
    'Close the presentation
    presentation__1.Close()
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved