Пример #1
0
 /// <summary>
 /// Set a pattern fill with a preset pattern, foreground color and background color.
 /// </summary>
 /// <param name="PresetPattern">A preset fill pattern.</param>
 /// <param name="ForegroundColorTheme">The theme color to be used for the foreground.</param>
 /// <param name="ForegroundColorTint">The tint applied to the foreground theme color, ranging from -1.0 to 1.0. Negative tints darken the theme color and positive tints lighten the theme color.</param>
 /// <param name="BackgroundColorTheme">The theme color to be used for the background.</param>
 /// <param name="BackgroundColorTint">The tint applied to the background theme color, ranging from -1.0 to 1.0. Negative tints darken the theme color and positive tints lighten the theme color.</param>
 public void SetPatternFill(A.PresetPatternValues PresetPattern, SLThemeColorIndexValues ForegroundColorTheme, double ForegroundColorTint, SLThemeColorIndexValues BackgroundColorTheme, double BackgroundColorTint)
 {
     this.Type          = SLFillType.PatternFill;
     this.PatternPreset = PresetPattern;
     this.PatternForegroundColor.SetColor(ForegroundColorTheme, ForegroundColorTint, 0);
     this.PatternBackgroundColor.SetColor(BackgroundColorTheme, BackgroundColorTint, 0);
 }
Пример #2
0
 /// <summary>
 /// Set a pattern fill with a preset pattern, foreground color and background color.
 /// </summary>
 /// <param name="PresetPattern">A preset fill pattern.</param>
 /// <param name="ForegroundColorTheme">The theme color to be used for the foreground.</param>
 /// <param name="BackgroundColor">The color to be used for the background.</param>
 public void SetPatternFill(A.PresetPatternValues PresetPattern, SLThemeColorIndexValues ForegroundColorTheme, System.Drawing.Color BackgroundColor)
 {
     this.Type          = SLFillType.PatternFill;
     this.PatternPreset = PresetPattern;
     this.PatternForegroundColor.SetColor(ForegroundColorTheme, 0, 0);
     this.PatternBackgroundColor.SetColor(BackgroundColor, 0);
 }
Пример #3
0
 /// <summary>
 ///     Set a pattern fill with a preset pattern, foreground color and background color.
 /// </summary>
 /// <param name="PresetPattern">A preset fill pattern.</param>
 /// <param name="ForegroundColor">The color to be used for the foreground.</param>
 /// <param name="BackgroundColor">The color to be used for the background.</param>
 public void SetPatternFill(A.PresetPatternValues PresetPattern, Color ForegroundColor, Color BackgroundColor)
 {
     Type          = SLFillType.PatternFill;
     PatternPreset = PresetPattern;
     PatternForegroundColor.SetColor(ForegroundColor, 0);
     PatternBackgroundColor.SetColor(BackgroundColor, 0);
 }
Пример #4
0
 /// <summary>
 ///     Set a pattern fill with a preset pattern, foreground color and background color.
 /// </summary>
 /// <param name="PresetPattern">A preset fill pattern.</param>
 /// <param name="ForegroundColorTheme">The theme color to be used for the foreground.</param>
 /// <param name="ForegroundColorTint">
 ///     The tint applied to the foreground theme color, ranging from -1.0 to 1.0. Negative
 ///     tints darken the theme color and positive tints lighten the theme color.
 /// </param>
 /// <param name="BackgroundColor">The color to be used for the background.</param>
 public void SetPatternFill(A.PresetPatternValues PresetPattern, SLThemeColorIndexValues ForegroundColorTheme,
                            double ForegroundColorTint, Color BackgroundColor)
 {
     Type          = SLFillType.PatternFill;
     PatternPreset = PresetPattern;
     PatternForegroundColor.SetColor(ForegroundColorTheme, ForegroundColorTint, 0);
     PatternBackgroundColor.SetColor(BackgroundColor, 0);
 }
Пример #5
0
 /// <summary>
 ///     Set a pattern fill with a preset pattern, foreground color and background color.
 /// </summary>
 /// <param name="PresetPattern">A preset fill pattern.</param>
 /// <param name="ForegroundColorTheme">The theme color to be used for the foreground.</param>
 /// <param name="BackgroundColorTheme">The theme color to be used for the background.</param>
 public void SetPatternFill(A.PresetPatternValues PresetPattern, SLThemeColorIndexValues ForegroundColorTheme,
                            SLThemeColorIndexValues BackgroundColorTheme)
 {
     Type          = SLFillType.PatternFill;
     PatternPreset = PresetPattern;
     PatternForegroundColor.SetColor(ForegroundColorTheme, 0, 0);
     PatternBackgroundColor.SetColor(BackgroundColorTheme, 0, 0);
 }
        public TFluent SetPatternFill(DocumentFormat.OpenXml.Drawing.PresetPatternValues pattern, OpenXmlColor background, OpenXmlColor foreground)
        {
            OpenXmlElement shapeProperties = this.element.GetOrCreateShapeProperties();

            shapeProperties.RemoveAllChildren <NoFill>();
            shapeProperties.RemoveAllChildren <SolidFill>();
            shapeProperties.RemoveAllChildren <GradientFill>();
            shapeProperties.RemoveAllChildren <BlipFill>();
            shapeProperties.RemoveAllChildren <PatternFill>();
            shapeProperties.RemoveAllChildren <GroupFill>();

            shapeProperties.AppendChild(new PatternFill()
            {
                Preset          = pattern,
                BackgroundColor = new BackgroundColor()
                                  .AppendChildFluent(background.CreateColorElement()),
                ForegroundColor = new ForegroundColor()
                                  .AppendChildFluent(foreground.CreateColorElement()),
            });

            return(this.result);
        }
Пример #7
0
        public TFluent SetPatternFill(DocumentFormat.OpenXml.Drawing.PresetPatternValues pattern, OpenXmlColor background, OpenXmlColor foreground)
        {
            OpenXmlElement fill = this.fillGenerator(true);

            fill.RemoveAllChildren <NoFill>();
            fill.RemoveAllChildren <SolidFill>();
            fill.RemoveAllChildren <GradientFill>();
            fill.RemoveAllChildren <BlipFill>();
            fill.RemoveAllChildren <PatternFill>();
            fill.RemoveAllChildren <GroupFill>();

            fill.AppendChild(new PatternFill()
            {
                Preset          = pattern,
                BackgroundColor = new BackgroundColor()
                                  .AppendChildFluent(background.CreateColorElement()),
                ForegroundColor = new ForegroundColor()
                                  .AppendChildFluent(foreground.CreateColorElement()),
            });

            return(this.result);
        }