Code for the first is as follows:
(Where AddInfoBox and PageBox are Rectanflef objects declared with appropriate size & location)
- Code: Select all
IAutoShape shape = slide.Shapes.AppendShape(ShapeType.Rectangle, AddlInfoBox);
shape.TextFrame.Paragraphs[0].Alignment = TextAlignmentType.Center;
shape.TextFrame.Text = "Attachment";
shape.Fill.FillType = Spire.Presentation.Drawing.FillFormatType.Solid;
shape.Fill.SolidColor.Color = Color.FromArgb(173, 103, 13); // burnt orange
shape.Line.Style = TextLineStyle.None;
shape.Line.Width = 0;
TextRange tr = shape.TextFrame.TextRange;
tr.FontHeight = 12;
tr.LatinFont = new TextFont("Arial");
tr.IsBold = TriState.True;
tr.Fill.SolidColor.Color = Color.White;
This works correctly, [Edit: I noticed it still has a thin black border on this box as well] so I would assume that setting the correct values for the same properties would work for the second part:
- Code: Select all
IAutoShape shape2 = slide.Shapes.AppendShape(ShapeType.Rectangle, PageBox);
shape2.TextFrame.Text = currentPage.ToString() + IntToLetters(++slideCount);
shape2.TextFrame.Paragraphs[0].Alignment = TextAlignmentType.Center;
shape2.Fill.FillType = Spire.Presentation.Drawing.FillFormatType.None;
shape2.Line.Style = TextLineStyle.None;
shape2.Line.Width = 0;
TextRange tr2 = shape2.TextFrame.TextRange;
tr2.FontHeight = 9;
tr2.LatinFont = new TextFont("Arial");
tr2.IsBold = TriState.False;
tr2.Fill.SolidColor.Color = Color.FromArgb(109, 110, 106);
This results in white text on a solid white fill with a black border. What am I missing here?
Spire.Presentation version is 3.4.1.9040.