Interface IShapeLineFormat
Represents interface for shape line format.
Namespace: Syncfusion.XlsIO
Assembly: Syncfusion.XlsIO.NET.dll
Syntax
public interface IShapeLineFormat
Properties
BackColor
Represents background color.
Declaration
Color BackColor { get; set; }
Property Value
Type |
---|
Color |
BackColorIndex
Represents background color index.
Declaration
ExcelKnownColors BackColorIndex { get; set; }
Property Value
Type |
---|
ExcelKnownColors |
BeginArrowheadLength
Represents begin arrow head length.
Declaration
ExcelShapeArrowLength BeginArrowheadLength { get; set; }
Property Value
Type |
---|
ExcelShapeArrowLength |
Examples
The following code illustrates how to set BeginArrowheadLength
property.
using (ExcelEngine excelEngine = new ExcelEngine())
{
//Create worksheet
IApplication application = excelEngine.Excel;
application.DefaultVersion = ExcelVersion.Excel2013;
IWorkbook workbook = application.Workbooks.Create(1);
IWorksheet worksheet = workbook.Worksheets[0];
//Add shape
IShape shape = worksheet.Shapes.AddAutoShapes(AutoShapeType.Line, 2, 2, 0, 100);
//Set line format
IShapeLineFormat lineFormat = shape.Line;
//Set arrow style
lineFormat.BeginArrowHeadStyle = ExcelShapeArrowStyle.LineArrowDiamond;
//Set arrow width
lineFormat.BeginArrowheadWidth = ExcelShapeArrowWidth.ArrowHeadWide;
//Set arrow Length
lineFormat.BeginArrowheadLength = ExcelShapeArrowLength.ArrowHeadLong;
//Save and dispose
workbook.SaveAs("Shapes.xlsx");
workbook.Close();
}
BeginArrowHeadStyle
Represents begin arrow head style.
Declaration
ExcelShapeArrowStyle BeginArrowHeadStyle { get; set; }
Property Value
Type |
---|
ExcelShapeArrowStyle |
Examples
The following code illustrates how to set BeginArrowHeadStyle
property.
using (ExcelEngine excelEngine = new ExcelEngine())
{
//Create worksheet
IApplication application = excelEngine.Excel;
application.DefaultVersion = ExcelVersion.Excel2013;
IWorkbook workbook = application.Workbooks.Create(1);
IWorksheet worksheet = workbook.Worksheets[0];
//Add shape
IShape shape = worksheet.Shapes.AddAutoShapes(AutoShapeType.Line, 2, 2, 0, 100);
//Set line format
IShapeLineFormat lineFormat = shape.Line;
//Set arrow style
lineFormat.BeginArrowHeadStyle = ExcelShapeArrowStyle.LineArrowDiamond;
lineFormat.EndArrowHeadStyle = ExcelShapeArrowStyle.LineArrowStealth;
//Save and dispose
workbook.SaveAs("Shapes.xlsx");
workbook.Close();
}
BeginArrowheadWidth
Represents begin arrow head width.
Declaration
ExcelShapeArrowWidth BeginArrowheadWidth { get; set; }
Property Value
Type |
---|
ExcelShapeArrowWidth |
Examples
The following code illustrates how to set BeginArrowheadWidth
property.
using (ExcelEngine excelEngine = new ExcelEngine())
{
//Create worksheet
IApplication application = excelEngine.Excel;
application.DefaultVersion = ExcelVersion.Excel2013;
IWorkbook workbook = application.Workbooks.Create(1);
IWorksheet worksheet = workbook.Worksheets[0];
//Add shape
IShape shape = worksheet.Shapes.AddAutoShapes(AutoShapeType.Line, 2, 2, 0, 100);
//Set line format
IShapeLineFormat lineFormat = shape.Line;
//Set arrow style
lineFormat.BeginArrowHeadStyle = ExcelShapeArrowStyle.LineArrowDiamond;
//Set arrow width
lineFormat.BeginArrowheadWidth = ExcelShapeArrowWidth.ArrowHeadWide;
//Set arrow Length
lineFormat.BeginArrowheadLength = ExcelShapeArrowLength.ArrowHeadLong;
//Save and dispose
workbook.SaveAs("Shapes.xlsx");
workbook.Close();
}
DashStyle
Represents the dash style for the specified line.
Declaration
ExcelShapeDashLineStyle DashStyle { get; set; }
Property Value
Type |
---|
ExcelShapeDashLineStyle |
Examples
By default Solid is set to DashStyle
. Here for example, we set Dash_Dot_Dot
to DashStyle
property.
using (ExcelEngine excelEngine = new ExcelEngine())
{
//Create worksheet
IApplication application = excelEngine.Excel;
application.DefaultVersion = ExcelVersion.Excel2013;
IWorkbook workbook = application.Workbooks.Create(1);
IWorksheet worksheet = workbook.Worksheets[0];
//Add shape
IShape shape = worksheet.Shapes.AddAutoShapes(AutoShapeType.Rectangle, 2, 2, 20, 100);
//Set line format
IShapeLineFormat lineFormat = shape.Line;
//Set line style
lineFormat.DashStyle = ExcelShapeDashLineStyle.Dash_Dot_Dot;
//Save and dispose
workbook.SaveAs("Shapes.xlsx");
workbook.Close();
}
EndArrowheadLength
Represents end arrow head length.
Declaration
ExcelShapeArrowLength EndArrowheadLength { get; set; }
Property Value
Type |
---|
ExcelShapeArrowLength |
Examples
The following code illustrates how to set EndArrowheadLength
property.
using (ExcelEngine excelEngine = new ExcelEngine())
{
//Create worksheet
IApplication application = excelEngine.Excel;
application.DefaultVersion = ExcelVersion.Excel2013;
IWorkbook workbook = application.Workbooks.Create(1);
IWorksheet worksheet = workbook.Worksheets[0];
//Add shape
IShape shape = worksheet.Shapes.AddAutoShapes(AutoShapeType.Line, 2, 2, 0, 100);
//Set line format
IShapeLineFormat lineFormat = shape.Line;
//Set arrow style
lineFormat.EndArrowHeadStyle = ExcelShapeArrowStyle.LineArrowStealth;
//Set arrow width
lineFormat.EndArrowheadWidth = ExcelShapeArrowWidth.ArrowHeadWide;
//Set arrow Length
lineFormat.EndArrowheadLength = ExcelShapeArrowLength.ArrowHeadLong;
//Save and dispose
workbook.SaveAs("Shapes.xlsx");
workbook.Close();
}
EndArrowHeadStyle
Represents end arrow head style.
Declaration
ExcelShapeArrowStyle EndArrowHeadStyle { get; set; }
Property Value
Type |
---|
ExcelShapeArrowStyle |
Examples
The following code illustrates how to set EndArrowHeadStyle
property.
using (ExcelEngine excelEngine = new ExcelEngine())
{
//Create worksheet
IApplication application = excelEngine.Excel;
application.DefaultVersion = ExcelVersion.Excel2013;
IWorkbook workbook = application.Workbooks.Create(1);
IWorksheet worksheet = workbook.Worksheets[0];
//Add shape
IShape shape = worksheet.Shapes.AddAutoShapes(AutoShapeType.Line, 2, 2, 0, 100);
//Set line format
IShapeLineFormat lineFormat = shape.Line;
//Set arrow style
lineFormat.BeginArrowHeadStyle = ExcelShapeArrowStyle.LineArrowDiamond;
lineFormat.EndArrowHeadStyle = ExcelShapeArrowStyle.LineArrowStealth;
//Save and dispose
workbook.SaveAs("Shapes.xlsx");
workbook.Close();
}
EndArrowheadWidth
Represents end arrow head width.
Declaration
ExcelShapeArrowWidth EndArrowheadWidth { get; set; }
Property Value
Type |
---|
ExcelShapeArrowWidth |
Examples
The following code illustrates how to set EndArrowheadWidth
property.
using (ExcelEngine excelEngine = new ExcelEngine())
{
//Create worksheet
IApplication application = excelEngine.Excel;
application.DefaultVersion = ExcelVersion.Excel2013;
IWorkbook workbook = application.Workbooks.Create(1);
IWorksheet worksheet = workbook.Worksheets[0];
//Add shape
IShape shape = worksheet.Shapes.AddAutoShapes(AutoShapeType.Line, 2, 2, 0, 100);
//Set line format
IShapeLineFormat lineFormat = shape.Line;
//Set arrow style
lineFormat.EndArrowHeadStyle = ExcelShapeArrowStyle.LineArrowStealth;
//Set arrow width
lineFormat.EndArrowheadWidth = ExcelShapeArrowWidth.ArrowHeadWide;
//Set arrow Length
lineFormat.EndArrowheadLength = ExcelShapeArrowLength.ArrowHeadLong;
//Save and dispose
workbook.SaveAs("Shapes.xlsx");
workbook.Close();
}
ForeColor
Represents foreground color.
Declaration
Color ForeColor { get; set; }
Property Value
Type |
---|
Color |
Examples
The following code illustrates how to set foreground color to the shape's line format from System.Drawing.Color structure.
using (ExcelEngine excelEngine = new ExcelEngine())
{
//Create worksheet
IApplication application = excelEngine.Excel;
application.DefaultVersion = ExcelVersion.Excel2013;
IWorkbook workbook = application.Workbooks.Create(1);
IWorksheet worksheet = workbook.Worksheets[0];
//Add shape
IShape shape = worksheet.Shapes.AddAutoShapes(AutoShapeType.Rectangle, 2, 2, 20, 100);
//Set line format
IShapeLineFormat lineFormat = shape.Line;
//Set color
lineFormat.ForeColor = System.Drawing.Color.Red;
//Save and dispose
workbook.SaveAs("Shapes.xlsx");
workbook.Close();
}
ForeColorIndex
Represents foreground color index.
Declaration
ExcelKnownColors ForeColorIndex { get; set; }
Property Value
Type |
---|
ExcelKnownColors |
Examples
The following code illustrates how to set foreground color to the shape's line format from ExcelKnownColors enumeration.
using (ExcelEngine excelEngine = new ExcelEngine())
{
//Create worksheet
IApplication application = excelEngine.Excel;
application.DefaultVersion = ExcelVersion.Excel2013;
IWorkbook workbook = application.Workbooks.Create(1);
IWorksheet worksheet = workbook.Worksheets[0];
//Add shape
IShape shape = worksheet.Shapes.AddAutoShapes(AutoShapeType.Rectangle, 2, 2, 20, 100);
//Set line format
IShapeLineFormat lineFormat = shape.Line;
//Set color
lineFormat.ForeColorIndex = ExcelKnownColors.Red;
//Save and dispose
workbook.SaveAs("Shapes.xlsx");
workbook.Close();
}
HasPattern
Indicates if current line format contain pattern.
Declaration
bool HasPattern { get; set; }
Property Value
Type |
---|
System.Boolean |
Pattern
Represents line pattern.
Declaration
ExcelGradientPattern Pattern { get; set; }
Property Value
Type |
---|
ExcelGradientPattern |
Style
Represents line style.
Declaration
ExcelShapeLineStyle Style { get; set; }
Property Value
Type |
---|
ExcelShapeLineStyle |
Examples
By default Line_Single is set to Style
. Here for example, we set Line_Thick_Between_Thin
to Style
property.
using (ExcelEngine excelEngine = new ExcelEngine())
{
//Create worksheet
IApplication application = excelEngine.Excel;
application.DefaultVersion = ExcelVersion.Excel2013;
IWorkbook workbook = application.Workbooks.Create(1);
IWorksheet worksheet = workbook.Worksheets[0];
//Add shape
IShape shape = worksheet.Shapes.AddAutoShapes(AutoShapeType.Rectangle, 2, 2, 20, 100);
//Set line format
IShapeLineFormat lineFormat = shape.Line;
//Set line style
lineFormat.Style = ExcelShapeLineStyle.Line_Thick_Between_Thin;
//Set line wight
lineFormat.Weight = 5;
//Save and dispose
workbook.SaveAs("Shapes.xlsx");
workbook.Close();
}
Transparency
Represents line transparency.
Declaration
double Transparency { get; set; }
Property Value
Type |
---|
System.Double |
Examples
The following code illustrates how to set Transparency
for the shape's line format.
using (ExcelEngine excelEngine = new ExcelEngine())
{
//Create worksheet
IApplication application = excelEngine.Excel;
application.DefaultVersion = ExcelVersion.Excel2013;
IWorkbook workbook = application.Workbooks.Create(1);
IWorksheet worksheet = workbook.Worksheets[0];
//Add shape
IShape shape = worksheet.Shapes.AddAutoShapes(AutoShapeType.Rectangle, 2, 2, 20, 100);
//Set line format
IShapeLineFormat lineFormat = shape.Line;
//Set transparency
lineFormat.Transparency = 0.5;
//Save and dispose
workbook.SaveAs("Shapes.xlsx");
workbook.Close();
}
Visible
Represents if line format is visible.
Declaration
bool Visible { get; set; }
Property Value
Type |
---|
System.Boolean |
Examples
The following code illustrates how to set visibility to shape's line format.
using (ExcelEngine excelEngine = new ExcelEngine())
{
//Create worksheet
IApplication application = excelEngine.Excel;
application.DefaultVersion = ExcelVersion.Excel2013;
IWorkbook workbook = application.Workbooks.Create(1);
IWorksheet worksheet = workbook.Worksheets[0];
//Add shape
IShape shape = worksheet.Shapes.AddAutoShapes(AutoShapeType.Rectangle, 2, 2, 20, 100);
//Set line format
IShapeLineFormat lineFormat = shape.Line;
//Set visibility
lineFormat.Visible = false;
//Save and dispose
workbook.SaveAs("Shapes.xlsx");
workbook.Close();
}
Weight
Represents weight of the line.
Declaration
double Weight { get; set; }
Property Value
Type |
---|
System.Double |
Examples
The following code illustrates how to set Weight
property.
using (ExcelEngine excelEngine = new ExcelEngine())
{
//Create worksheet
IApplication application = excelEngine.Excel;
application.DefaultVersion = ExcelVersion.Excel2013;
IWorkbook workbook = application.Workbooks.Create(1);
IWorksheet worksheet = workbook.Worksheets[0];
//Add shape
IShape shape = worksheet.Shapes.AddAutoShapes(AutoShapeType.Rectangle, 2, 2, 20, 100);
//Set line format
IShapeLineFormat lineFormat = shape.Line;
//Set weight
lineFormat.Weight = 6;
//Save and dispose
workbook.SaveAs("Shapes.xlsx");
workbook.Close();
}