Interface IPatternFill
Represents the pattern type in fill format.
Namespace: Syncfusion.Presentation
Assembly: Syncfusion.Presentation.Base.dll
Syntax
public interface IPatternFill
Properties
BackColor
Gets or sets the back color for the pattern.
Declaration
IColor BackColor { get; set; }
Property Value
Type | Description |
---|---|
IColor | The color of the background. |
Examples
//Create a new presentation.
IPresentation presentation = Presentation.Create();
//Add a slide to the presentation.
ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
//Add shape to slide
IShape shape = slide.Shapes.AddShape(AutoShapeType.BlockArc, 12, 23, 100, 220);
//Retrieve fill from shape
IFill fill = shape.Fill;
//Set pattern fill type to shape
fill.FillType = FillType.Pattern;
//Retrieve the pattern fill
IPatternFill patternFill = fill.PatternFill;
//Set back color for the pattern
patternFill.BackColor = ColorObject.Blue;
//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)
'Add shape to slide
Dim shape As IShape = slide.Shapes.AddShape(AutoShapeType.BlockArc, 12, 23, 100, 220)
'Retrieve fill from shape
Dim fill As IFill = shape.Fill
'Set pattern fill type to shape
fill.FillType = FillType.Pattern
'Retrieve the pattern fill
Dim patternFill As IPatternFill = fill.PatternFill
'Set back color for the pattern
patternFill.BackColor = ColorObject.Blue
'Save the presentation
presentation__1.Save("Sample.pptx")
'Close the presentation
presentation__1.Close()
ForeColor
Gets or sets the foreground color for the pattern.
Declaration
IColor ForeColor { get; set; }
Property Value
Type | Description |
---|---|
IColor | The color of the foreground. |
Examples
//Create a new presentation.
IPresentation presentation = Presentation.Create();
//Add a slide to the presentation.
ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
//Add shape to slide
IShape shape = slide.Shapes.AddShape(AutoShapeType.BlockArc, 12, 23, 100, 220);
//Retrieve fill from shape
IFill fill = shape.Fill;
//Set pattern fill type to shape
fill.FillType = FillType.Pattern;
//Retrieve the pattern fill
IPatternFill patternFill = fill.PatternFill;
//Set fore color for the pattern
patternFill.ForeColor = ColorObject.Blue;
//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)
'Add shape to slide
Dim shape As IShape = slide.Shapes.AddShape(AutoShapeType.BlockArc, 12, 23, 100, 220)
'Retrieve fill from shape
Dim fill As IFill = shape.Fill
'Set pattern fill type to shape
fill.FillType = FillType.Pattern
'Retrieve the pattern fill
Dim patternFill As IPatternFill = fill.PatternFill
'Set fore color for the pattern
patternFill.ForeColor = ColorObject.Blue
'Save the presentation
presentation__1.Save("Sample.pptx")
'Close the presentation
presentation__1.Close()
Pattern
Gets of sets a pattern type of the fill format.
Declaration
PatternFillType Pattern { get; set; }
Property Value
Type | Description |
---|---|
PatternFillType | The pattern. |
Examples
//Create a new presentation.
IPresentation presentation = Presentation.Create();
//Add a slide to the presentation.
ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
//Add shape to slide
IShape shape = slide.Shapes.AddShape(AutoShapeType.BlockArc, 12, 23, 100, 220);
//Retrieve fill from shape
IFill fill = shape.Fill;
//Set pattern fill type to shape
fill.FillType = FillType.Pattern;
//Retrieve the pattern fill
IPatternFill patternFill = fill.PatternFill;
//Set the pattern type
patternFill.Pattern = PatternFillType.DashedDownwardDiagonal;
//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)
'Add shape to slide
Dim shape As IShape = slide.Shapes.AddShape(AutoShapeType.BlockArc, 12, 23, 100, 220)
'Retrieve fill from shape
Dim fill As IFill = shape.Fill
'Set pattern fill type to shape
fill.FillType = FillType.Pattern
'Retrieve the pattern fill
Dim patternFill As IPatternFill = fill.PatternFill
'Set the pattern type
patternFill.Pattern = PatternFillType.DashedDownwardDiagonal
'Save the presentation
presentation__1.Save("Sample.pptx")
'Close the presentation
presentation__1.Close()