FillFormat Class
Represents the fill format options for the Shape in the Word document.
Inheritance
System.Object
FillFormat
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Syncfusion.DocIO.DLS
Assembly: Syncfusion.DocIO.Base.dll
Syntax
public class FillFormat
Examples
The following code example demonstrates how to set the fill format to the shape in the document.
private void Button1_Click(System.Object sender, System.EventArgs e)
{
//Create a new Word document
WordDocument document = new WordDocument();
//Add the section into Word document
WSection section = document.AddSection() as WSection;
//Add a paragraph to created section
WParagraph paragraph = section.AddParagraph() as WParagraph;
string paraText = "Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula";
//Append the text to the created paragraph
paragraph.AppendText(paraText);
//Add a paragraph to created section
paragraph = section.AddParagraph() as WParagraph;
//Add the rectangle shape to the document
Syncfusion.DocIO.DLS.Shape shape = paragraph.AppendShape(AutoShapeType.Rectangle, 200, 75);
//Set wrapping type as inline
shape.WrapFormat.TextWrappingStyle = TextWrappingStyle.Inline;
//Set the fillformat for the shape
shape.FillFormat.Color = Color.AliceBlue;
shape.FillFormat.Fill = true;
shape.FillFormat.Transparency = 60;
//Save and close the Word document instance
document.Save("Sample.docx", FormatType.Docx);
document.Close();
}
Private Sub button_Click(sender As Object, e As EventArgs)
'Create a new Word document
Dim document As New WordDocument()
'Add the section into Word document
Dim section As WSection = TryCast(document.AddSection(), WSection)
'Add a paragraph to created section
Dim paragraph As WParagraph = TryCast(section.AddParagraph(), WParagraph)
Dim paraText As String = "Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula"
'Append the text to the created paragraph
paragraph.AppendText(paraText)
'Add a paragraph to created section
paragraph = TryCast(section.AddParagraph(), WParagraph)
'Add the rectangle shape to the document
Dim shape As Syncfusion.DocIO.DLS.Shape = paragraph.AppendShape(AutoShapeType.Rectangle, 200, 75)
'Set wrapping type as inline
shape.WrapFormat.TextWrappingStyle = TextWrappingStyle.Inline
'Set the fillformat for the shape
shape.FillFormat.Color = Color.AliceBlue
shape.FillFormat.Fill = True
shape.FillFormat.Transparency = 60
'Save and close the Word document instance
document.Save("Sample.docx", FormatType.Docx)
document.Close()
End Sub
Constructors
FillFormat(Shape)
Initializes a new instance of FillFormat class.
Declaration
public FillFormat(Shape shape)
Parameters
Type | Name | Description |
---|---|---|
Shape | shape | The Shape to which the fill effects should be added. |
Properties
Color
Gets or sets the color to fill
Declaration
public Color Color { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.Color | The System.Drawing.Color specifies the fill color. |
Fill
Gets or sets a value indicating whether to fill with color.
Declaration
public bool Fill { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True if need to fill with color; otherwise, false. |
Transparency
Gets or sets the transparency value measured in percentage(%).
Declaration
public float Transparency { get; set; }
Property Value
Type | Description |
---|---|
System.Single | The float that represents the transparency value. |