Solid
Contents
[
Hide
]Solid()
Sets the fill to a uniform color.
public void Solid()
Remarks
Use this method to convert any of the fills back to solid fill.
Examples
Shows how to convert any of the fills back to solid fill.
Document doc = new Document(MyDir + "Two color gradient.docx");
// Get Fill object for Font of the first Run.
Fill fill = doc.FirstSection.Body.Paragraphs[0].Runs[0].Font.Fill;
// Check Fill properties of the Font.
Console.WriteLine("The type of the fill is: {0}", fill.FillType);
Console.WriteLine("The foreground color of the fill is: {0}", fill.ForeColor);
Console.WriteLine("The fill is transparent at {0}%", fill.Transparency * 100);
// Change type of the fill to Solid with uniform green color.
fill.Solid();
Console.WriteLine("\nThe fill is changed:");
Console.WriteLine("The type of the fill is: {0}", fill.FillType);
Console.WriteLine("The foreground color of the fill is: {0}", fill.ForeColor);
Console.WriteLine("The fill transparency is {0}%", fill.Transparency * 100);
doc.Save(ArtifactsDir + "Drawing.FillSolid.docx");
See Also
- class Fill
- namespace Aspose.Words.Drawing
- assembly Aspose.Words
Solid(Color)
Sets the fill to a specified uniform color.
public void Solid(Color color)
Remarks
Use this method to convert any of the fills back to solid fill.
Examples
Shows how to use chart formating.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
Shape shape = builder.InsertChart(ChartType.Column, 432, 252);
Chart chart = shape.Chart;
// Delete series generated by default.
ChartSeriesCollection series = chart.Series;
series.Clear();
string[] categories = new string[] { "Category 1", "Category 2" };
series.Add("Series 1", categories, new double[] { 1, 2 });
series.Add("Series 2", categories, new double[] { 3, 4 });
// Format chart background.
chart.Format.Fill.Solid(Color.DarkSlateGray);
// Hide axis tick labels.
chart.AxisX.TickLabels.Position = AxisTickLabelPosition.None;
chart.AxisY.TickLabels.Position = AxisTickLabelPosition.None;
// Format chart title.
chart.Title.Format.Fill.Solid(Color.LightGoldenrodYellow);
// Format axis title.
chart.AxisX.Title.Show = true;
chart.AxisX.Title.Format.Fill.Solid(Color.LightGoldenrodYellow);
// Format legend.
chart.Legend.Format.Fill.Solid(Color.LightGoldenrodYellow);
doc.Save(ArtifactsDir + "Charts.ChartFormat.docx");
See Also
- class Fill
- namespace Aspose.Words.Drawing
- assembly Aspose.Words