GemBox.Spreadsheet
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    FillFormat Class

    Namespace:
    GemBox.Spreadsheet.Drawing
    Assembly:
    GemBox.Spreadsheet.dll

    Represents a base class for fills such as solid, gradient, pattern, etc.

    • C#
    • VB.NET
    public abstract class FillFormat
    Public MustInherit Class FillFormat
    Inheritance:
    System.Object
    FillFormat
    Derived
    GradientFillFormat
    PatternFillFormat
    PictureFillFormat
    SolidFillFormat

    Properties

    FillType

    Gets the type of the fill.

    • C#
    • VB.NET
    public abstract FillFormatType FillType { get; }
    Public MustOverride ReadOnly Property FillType As FillFormatType
    Property Value
    FillFormatType

    The type of the fill.

    Methods

    SetGradient(GradientFillType)

    Sets the fill to the gradient fill.

    • C#
    • VB.NET
    public GradientFillFormat SetGradient(GradientFillType type)
    Public Function SetGradient(type As GradientFillType) As GradientFillFormat
    Parameters
    type
    GradientFillType

    Type of the gradient fill.

    Returns
    GradientFillFormat

    An instance of a PatternFillFormat type that was set.

    SetNone()

    Sets the fill to none, thus making the area transparent.

    • C#
    • VB.NET
    public FillFormat SetNone()
    Public Function SetNone As FillFormat
    Returns
    FillFormat

    An instance of a FillFormat type that represents no fill that was set.

    SetPattern(PatternFillType, DrawingColor, DrawingColor)

    Sets the fill to the pattern fill.

    • C#
    • VB.NET
    public PatternFillFormat SetPattern(PatternFillType patternType, DrawingColor foregroundColor, DrawingColor backgroundColor)
    Public Function SetPattern(patternType As PatternFillType, foregroundColor As DrawingColor, backgroundColor As DrawingColor) As PatternFillFormat
    Parameters
    patternType
    PatternFillType

    Type of the pattern fill.

    foregroundColor
    DrawingColor

    Foreground color of the pattern fill.

    backgroundColor
    DrawingColor

    Background color of the pattern fill.

    Returns
    PatternFillFormat

    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.

    • C#
    • VB.NET
    public PictureFillFormat SetPicture(Content content)
    Public Function SetPicture(content As Content) As PictureFillFormat
    Parameters
    content
    Content

    Content of the picture source.

    Returns
    PictureFillFormat

    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 source.

    Exceptions
    System.ArgumentNullException

    content is null.

    SetPicture(Stream)

    Sets the fill to the picture fill.

    This method is not applicable on Fill property.

    • C#
    • VB.NET
    public PictureFillFormat SetPicture(Stream stream)
    Public Function SetPicture(stream As Stream) As PictureFillFormat
    Parameters
    stream
    System.IO.Stream

    Stream containing the picture source.

    Returns
    PictureFillFormat

    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 to automatically detect the picture content type from the decoded picture stream.

    Exceptions
    System.ArgumentNullException

    stream is null.

    System.ArgumentException

    Picture stream encoding format is not supported.

    SetPicture(Stream, PictureContentType)

    Sets the fill to the picture fill.

    This method is not applicable on Fill property.

    • C#
    • VB.NET
    public PictureFillFormat SetPicture(Stream stream, PictureContentType contentType)
    Public Function SetPicture(stream As Stream, contentType As PictureContentType) As PictureFillFormat
    Parameters
    stream
    System.IO.Stream

    Stream containing the picture source.

    contentType
    PictureContentType

    Content type of the picture source.

    Returns
    PictureFillFormat

    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 to explicitly specify picture content type so that the picture stream doesn't have to be decoded to detect the picture content type.

    Exceptions
    System.ArgumentNullException

    stream is null.

    SetPicture(Stream, String)

    Sets the fill to the picture fill.

    This method is not applicable on Fill property.

    • C#
    • VB.NET
    public PictureFillFormat SetPicture(Stream stream, string contentType)
    Public Function SetPicture(stream As Stream, contentType As String) As PictureFillFormat
    Parameters
    stream
    System.IO.Stream

    Stream containing the picture source.

    contentType
    System.String

    Content type (MIME type) of the picture source.

    Returns
    PictureFillFormat

    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 to explicitly specify picture content type that is not supported by the PictureContentType.

    Exceptions
    System.ArgumentNullException

    stream is null.

    System.ArgumentException

    contentType is null or System.String.Empty.

    SetPicture(String, PictureContentType)

    Sets the fill to the picture fill.

    This method is not applicable on Fill property.

    • C#
    • VB.NET
    public PictureFillFormat SetPicture(string picturePath, PictureContentType contentType)
    Public Function SetPicture(picturePath As String, contentType As PictureContentType) As PictureFillFormat
    Parameters
    picturePath
    System.String

    Path to a picture source.

    contentType
    PictureContentType

    Content type of the picture source.

    Returns
    PictureFillFormat

    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 to explicitly specify picture content type (for example, if picturePath doesn't specify a file extension).

    Exceptions
    System.ArgumentException

    picturePath is null or System.String.Empty.

    SetPicture(String, Boolean)

    Sets the fill to the picture fill.

    This method is not applicable on Fill property.

    • C#
    • VB.NET
    public PictureFillFormat SetPicture(string picturePath, bool isLink = false)
    Public Function SetPicture(picturePath As String, isLink As Boolean = False) As PictureFillFormat
    Parameters
    picturePath
    System.String

    Path or link to a picture source.

    isLink
    System.Boolean

    true if the picture is linked to the file in which ExcelFile instance is saved; otherwise, false.

    Returns
    PictureFillFormat

    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 to automatically detect the picture content type from the picturePath extension.

    Parameter picturePath must contain supported extension (for example, ".png") if isLink is false, otherwise exception is thrown.

    Exceptions
    System.ArgumentException

    picturePath is null or System.String.Empty or picturePath doesn't contain extension or extension is not supported.

    SetPicture(String, String)

    Sets the fill to the picture fill.

    This method is not applicable on Fill property.

    • C#
    • VB.NET
    public PictureFillFormat SetPicture(string picturePath, string contentType)
    Public Function SetPicture(picturePath As String, contentType As String) As PictureFillFormat
    Parameters
    picturePath
    System.String

    Path to a picture source.

    contentType
    System.String

    Content type (MIME type) of the picture source.

    Returns
    PictureFillFormat

    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 to explicitly specify picture content type that is not supported by the PictureContentType.

    Exceptions
    System.ArgumentException

    picturePath or contentType is null or System.String.Empty.

    SetSolid(DrawingColor)

    Sets the fill to the solid fill.

    • C#
    • VB.NET
    public SolidFillFormat SetSolid(DrawingColor color)
    Public Function SetSolid(color As DrawingColor) As SolidFillFormat
    Parameters
    color
    DrawingColor

    The color of the solid fill.

    Returns
    SolidFillFormat

    An instance of a SolidFillFormat type that was set.

    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.