Spire.Presentation is a professional PowerPoint® compatible library that enables developers to create, read, write, modify, convert and Print PowerPoint documents. Get free and professional technical support for Spire.Presentation for .NET, Java, Android, C++, Python.

Wed Mar 18, 2015 7:44 pm

Here is the code I am using:
IAutoShape shape = slide.Shapes.AppendShape(ShapeType.Rectangle, new RectangleF(pos, TLtop, TLqtrW, TLcellH));
shape.TextFrame.Text = "Q" + q.ToString();

shape.Fill.FillType = FillFormatType.Gradient;
shape.Fill.Gradient.GradientStyle = GradientStyle.FromCorner2;
shape.Fill.Gradient.LinearGradientFill.Angle = 90;
shape.Fill.Gradient.LinearGradientFill.IsScaled = TriState.True;
shape.Fill.Gradient.GradientStops.Append(0, Color.White);
shape.Fill.Gradient.GradientStops.Append(1, Color.LightGray);

TextRange tr = shape.TextFrame.TextRange;
tr.Paragraph.Alignment = TextAlignmentType.Center;
tr.Fill.SolidColor.ColorType = ColorType.RGB;
tr.Fill.SolidColor.Color = Color.Black;
tr.FontHeight = 12;
tr.Fill.FillType = FillFormatType.Solid;
tr.LatinFont = new TextFont("Calibre");

No matter what I set the angle to the gradient does not change the direction it is drawn. I need to rotate it so it starts at the top and ends at the bottom.

Thank you.

miehas
 
Posts: 2
Joined: Tue Mar 17, 2015 5:57 pm

Thu Mar 19, 2015 7:50 am

Hello,

Thank you for your inquiry.
Please add this line of code:
Code: Select all
shape.Fill.Gradient.GradientShape = GradientShapeType.Linear;

before:
Code: Select all
shape.Fill.Gradient.LinearGradientFill.Angle = 90;
User avatar

sweety1
 
Posts: 539
Joined: Wed Mar 11, 2015 1:14 am

Thu Mar 19, 2015 1:47 pm

Thank you that was what I was missing.

miehas
 
Posts: 2
Joined: Tue Mar 17, 2015 5:57 pm

Fri Mar 20, 2015 2:44 am

Hello,

Please feel free to contact us, if you have any questions or needs. We are here for help.

Best Regards,
Sweety
E-iceblue support team
User avatar

sweety1
 
Posts: 539
Joined: Wed Mar 11, 2015 1:14 am

Return to Spire.Presentation