FillFormat Class
Represents a base class for fills such as solid, gradient, picture, pattern, etc. that can be applied to various objects, such as shapes, text characters, table cells and their outlines, borders and underlines.
- Inheritance:
- System.ObjectFillFormat
- Derived
Properties
FillType
Gets the type of the fill.
public abstract FillFormatType FillType { get; }
Public MustOverride ReadOnly Property FillType As FillFormatType
Property Value
The type of the fill.
Methods
SetGradient(GradientFillType)
Sets the fill to the gradient fill.
public GradientFillFormat SetGradient(GradientFillType gradientFillType)
Public Function SetGradient(gradientFillType As GradientFillType) As GradientFillFormat
Parameters
gradientFillType
- GradientFillType
The type of the gradient.
Returns
An instance of a GradientFillFormat type that was set and can be used to set the type and stops of the gradient fill.
SetNone()
Sets the fill to none, thus making the area transparent.
Returns
An instance of a FillFormat type that represents no fill that was set.
SetPattern(PatternFillType, Color, Color)
Sets the fill to the pattern fill.
public PatternFillFormat SetPattern(PatternFillType patternType, Color foregroundColor, Color backgroundColor)
Public Function SetPattern(patternType As PatternFillType, foregroundColor As Color, backgroundColor As Color) As PatternFillFormat
Parameters
patternType
- PatternFillType
Type of the pattern fill.
foregroundColor
- Color
Foreground color of the pattern fill.
backgroundColor
- Color
Background color of the pattern fill.
Returns
An instance of a PatternFillFormat type that was set.
SetPicture(Content)
Sets the fill to the picture fill.
This method is not applicable on Fill property.
public PictureFillFormat SetPicture(Content content)
Public Function SetPicture(content As Content) As PictureFillFormat
Parameters
content
- Content
Content of the picture data.
Returns
An instance of a PictureFillFormat type that was set and can be used to set tiling or stretch options of the picture fill.
Remarks
Use this overload if multiple PictureFillFormats should share the same picture data.
Exceptions
- System.ArgumentNullException
content
is null.
SetPicture(PictureContentType, Stream)
Sets the fill to the picture fill.
This method is not applicable on Fill property.
public PictureFillFormat SetPicture(PictureContentType contentType, Stream stream)
Public Function SetPicture(contentType As PictureContentType, stream As Stream) As PictureFillFormat
Parameters
contentType
- PictureContentType
Content type of the picture data.
stream
- System.IO.Stream
Stream containing the picture data.
Returns
An instance of a PictureFillFormat type that was set and can be used to set tiling or stretch options of the picture fill.
Exceptions
- System.ArgumentNullException
stream
is null.
SetPicture(String)
Sets the fill to the picture fill.
This method is not applicable on Fill property.
public PictureFillFormat SetPicture(string link)
Public Function SetPicture(link As String) As PictureFillFormat
Parameters
link
- System.String
Link to a picture data.
Returns
An instance of a PictureFillFormat type that was set and can be used to set tiling or stretch options of the picture fill.
Exceptions
- System.ArgumentException
link
is null or System.String.Empty.
SetPicture(String, Stream)
Sets the fill to the picture fill.
This method is not applicable on Fill property.
public PictureFillFormat SetPicture(string contentType, Stream stream)
Public Function SetPicture(contentType As String, stream As Stream) As PictureFillFormat
Parameters
contentType
- System.String
Content type (MIME type) of the picture data.
stream
- System.IO.Stream
Stream containing the picture data.
Returns
An instance of a PictureFillFormat type that was set and can be used to set tiling or stretch options of the picture fill.
Exceptions
- System.ArgumentException
contentType
is null or System.String.Empty.
- System.ArgumentNullException
stream
is null.
SetSlideBackground()
Sets the fill of the Shape to that of the slide background surface. Applicable only on Shape's fill.
This method does not set the fill of the shape to be transparent but instead sets it to be filled with the portion of the slide background that is directly behind it.
Returns
An instance of a FillFormat type that represents slide background fill that was set.
Exceptions
- System.InvalidOperationException
Setting the fill to the slide's background is only supported on Shape's fill.
SetSolid(Color)
Sets the fill to the solid fill.
public SolidFillFormat SetSolid(Color color)
Public Function SetSolid(color As Color) As SolidFillFormat
Parameters
color
- Color
The color of the solid fill.
Returns
An instance of a SolidFillFormat type that was set.