aspose.cells

Class FillFormat

Encapsulates the object that represents fill formatting for a shape.

Example:

$workbook = new cells\Workbook();
$charts = $workbook->getWorksheets()->get(0)->getCharts();
//Create a chart
$chart = $charts->get($charts->add(cells\ChartType::COLUMN, 1, 1, 10, 10));
$cells = $workbook->getWorksheets()->get(0)->getCells();
for($i=0; $i<3; $i++)
{
    $cells->get($i, 0)->putValue($i+1);
    $cells->get($i, 1)->putValue($i+5);
}
$chart->NSeries->Add("A1:B3", true);
//Filling the area of the 2nd NSeries with a gradient
$chart->getNSeries()->get(1)->getArea()->getFillFormat()->setOneColorGradient(cells\Color::getLime(), 1, cells\GradientStyleType::HORIZONTAL, 1);

Property Getters/Setters Summary
functiongetFillType()
function
           Gets and sets fill type The value of the property is FillType integer constant.
functiongetGradientColor1()
Returns the gradient color 1 for the the specified fill.
functiongetGradientColor2()
Returns the gradient color 2 for the the specified fill.
functiongetGradientColorType()
Returns the gradient color type for the specified fill. The value of the property is GradientColorType integer constant.
functiongetGradientDegree()
Returns the gradient degree for the the specified fill. Only applies for Excel 2007.
functiongetGradientFill()
Gets GradientFill object.
functiongetGradientStyle()
Returns the gradient style for the specified fill. The value of the property is GradientStyleType integer constant.
functiongetGradientVariant()
Returns the gradient variant for the the specified fill. Only applies for Excel 2007.
functiongetImageData()
function
           Gets and sets the picture image data.
functiongetPattern()
function
setPattern(value)
           Represents an area's display pattern. The value of the property is FillPattern integer constant.
functiongetPatternFill()
Gets PatternFill object.
functiongetPictureFormatType()
function
           Gets and sets the picture format type. The value of the property is FillPictureType integer constant.
functiongetPresetColor()
Returns the gradient preset color for the the specified fill. The value of the property is GradientPresetType integer constant.
functiongetScale()
function
setScale(value)
           Gets and sets the picture format scale.
functiongetSetType()
function
setSetType(value)
           Gets the fill format set type. The value of the property is FormatSetType integer constant.
functiongetSolidFill()
Gets SolidFill object.
functiongetTexture()
function
setTexture(value)
           Represents the texture type for the specified fill. The value of the property is TextureType integer constant.
functiongetTextureFill()
Gets TextureFill object.
functiongetTransparency()
function
           Returns or sets the degree of transparency of the area as a value from 0.0 (opaque) through 1.0 (clear).
functiongetType()
function
setType(value)
           Gets and sets the fill type. The value of the property is FillType integer constant.
 
Method Summary
functionsetOneColorGradient(color, degree, style, variant)
Sets the specified fill to a one-color gradient. Only applies for Excel 2007.
functionsetPresetColorGradient(presetColor, style, variant)
Sets the specified fill to a preset-color gradient. Only applies for Excel 2007.
functionsetTwoColorGradient(color1, color2, style, variant)
Sets the specified fill to a two-color gradient. Only applies for Excel 2007.
functionsetTwoColorGradient(color1, transparency1, color2, transparency2, style, variant)
Sets the specified fill to a two-color gradient. Only applies for Excel 2007.
 

    • Property Getters/Setters Detail

      • getType/setType : Number 

        function getType() / function setType(value)
        
        Gets and sets the fill type. The value of the property is FillType integer constant. NOTE: This member is now obsolete. Instead, please use FillFormat.FillType property instead. This property will be removed 12 months later since July 2016. Aspose apologizes for any inconvenience you may have experienced.
      • getFillType/setFillType : Number 

        function getFillType() / function setFillType(value)
        
        Gets and sets fill type The value of the property is FillType integer constant.
      • getTransparency/setTransparency : Number 

        function getTransparency() / function setTransparency(value)
        
        Returns or sets the degree of transparency of the area as a value from 0.0 (opaque) through 1.0 (clear).
      • getSetType/setSetType : Number 

        function getSetType() / function setSetType(value)
        
        Gets the fill format set type. The value of the property is FormatSetType integer constant. NOTE: This member is now obsolete. Instead, please use FillFormat.FillType property instead. This property will be removed 12 months later since July 2016. Aspose apologizes for any inconvenience you may have experienced.
      • getGradientFill : GradientFill 

        function getGradientFill()
        
        Gets GradientFill object.
      • getTextureFill : TextureFill 

        function getTextureFill()
        
        Gets TextureFill object.
      • getSolidFill : SolidFill 

        function getSolidFill()
        
        Gets SolidFill object.
      • getPatternFill : PatternFill 

        function getPatternFill()
        
        Gets PatternFill object.
      • getGradientColorType : Number 

        function getGradientColorType()
        
        Returns the gradient color type for the specified fill. The value of the property is GradientColorType integer constant.
      • getGradientStyle : Number 

        function getGradientStyle()
        
        Returns the gradient style for the specified fill. The value of the property is GradientStyleType integer constant.
      • getGradientColor1 : Color 

        function getGradientColor1()
        
        Returns the gradient color 1 for the the specified fill.
      • getGradientColor2 : Color 

        function getGradientColor2()
        
        Returns the gradient color 2 for the the specified fill. Only when the graident color type is GradientColorType.TwoColors, this property is meaningful.
      • getGradientDegree : Number 

        function getGradientDegree()
        
        Returns the gradient degree for the the specified fill. Only applies for Excel 2007. Can only be a value from 0.0 (dark) through 1.0 (light).
      • getGradientVariant : Number 

        function getGradientVariant()
        
        Returns the gradient variant for the the specified fill. Only applies for Excel 2007. Can only be a value from 1 through 4, corresponding to one of the four variants on the Gradient tab in the Fill Effects dialog box. If style is GradientStyle.FromCenter, the Variant argument can only be 1 or 2.
      • getPresetColor : Number 

        function getPresetColor()
        
        Returns the gradient preset color for the the specified fill. The value of the property is GradientPresetType integer constant.
      • getTexture/setTexture : Number 

        function getTexture() / function setTexture(value)
        
        Represents the texture type for the specified fill. The value of the property is TextureType integer constant.
      • getPattern/setPattern : Number 

        function getPattern() / function setPattern(value)
        
        Represents an area's display pattern. The value of the property is FillPattern integer constant.
      • getPictureFormatType/setPictureFormatType : Number 

        function getPictureFormatType() / function setPictureFormatType(value)
        
        Gets and sets the picture format type. The value of the property is FillPictureType integer constant.
      • getScale/setScale : Number 

        function getScale() / function setScale(value)
        
        Gets and sets the picture format scale.
      • getImageData/setImageData : byte[] 

        function getImageData() / function setImageData(value)
        
        Gets and sets the picture image data. If the fill format is not custom texture format,return null.
    • Method Detail

      • setOneColorGradient

        function setOneColorGradient(color, degree, style, variant)
        Sets the specified fill to a one-color gradient. Only applies for Excel 2007.
        Parameters:
        color: Color - One gradient color.
        degree: Number - The gradient degree. Can be a value from 0.0 (dark) through 1.0 (light).
        style: Number - A GradientStyleType value. Gradient shading style.
        variant: Number - The gradient variant. Can be a value from 1 through 4, corresponding to one of the four variants on the Gradient tab in the Fill Effects dialog box. If style is GradientStyle.FromCenter, the Variant argument can only be 1 or 2.
      • setTwoColorGradient

        function setTwoColorGradient(color1, color2, style, variant)
        Sets the specified fill to a two-color gradient. Only applies for Excel 2007.
        Parameters:
        color1: Color - One gradient color.
        color2: Color - Two gradient color.
        style: Number - A GradientStyleType value. Gradient shading style.
        variant: Number - The gradient variant. Can be a value from 1 through 4, corresponding to one of the four variants on the Gradient tab in the Fill Effects dialog box. If style is GradientStyle.FromCenter, the Variant argument can only be 1 or 2.
      • setTwoColorGradient

        function setTwoColorGradient(color1, transparency1, color2, transparency2, style, variant)
        Sets the specified fill to a two-color gradient. Only applies for Excel 2007.
        Parameters:
        color1: Color - One gradient color.
        transparency1: Number - The degree of transparency of the color1 as a value from 0.0 (opaque) through 1.0 (clear).
        color2: Color - Two gradient color.
        transparency2: Number - The degree of transparency of the color2 as a value from 0.0 (opaque) through 1.0 (clear).
        style: Number - A GradientStyleType value. Gradient shading style.
        variant: Number - The gradient variant. Can be a value from 1 through 4, corresponding to one of the four variants on the Gradient tab in the Fill Effects dialog box. If style is GradientStyle.FromCenter, the Variant argument can only be 1 or 2.
      • setPresetColorGradient

        function setPresetColorGradient(presetColor, style, variant)
        Sets the specified fill to a preset-color gradient. Only applies for Excel 2007.
        Parameters:
        presetColor: Number - A GradientPresetType value. Preset color type
        style: Number - A GradientStyleType value. Gradient shading style.
        variant: Number - The gradient variant. Can be a value from 1 through 4, corresponding to one of the four variants on the Gradient tab in the Fill Effects dialog box. If style is GradientStyle.FromCenter, the Variant argument can only be 1 or 2.