1

I am trying to add bevel 3d effect to a shape programmatically using aspose.slides and it doesn't seem to be working.

What is weird is when i actually go into powerpoint and click "Format Shape", it does seem like all of the settings that I am setting below are being set but I don't see any 3d effect (see my picture below). If, once in powerpoint, I click on any of the settings (even reclicking settings that are already are set like BevelTop = circle, then it does take effect at that point.

Am I doing something wrong below?

I have attached a picture to help illustrate the issue.

enter image description here

On the left is what I am trying to create with my code and on the right side of the picture is what is actually showing up. Here is my code below

 IShape shape = slide.Shapes.AddAutoShape(ShapeType.Ellipse, 30, 30, 13, 13);
 shape.FillFormat.FillType = FillType.Solid;
  shape.FillFormat.SolidFillColor.Color = GetGreenColor();
 ILineFillFormat fillFormat = shape.LineFormat.Fillformat;
 fillformat.FillType = FillType.Solid
 fillFormat.SolidFillColor.Color = GetOrangeColor();
 shape.LineFormat.Width = 2.0;
 shape.ThreeDFormat.BevelTop.BevelType = BevelPresetType.Circle;
 shape.ThreeDFormat.BevelTop.Height = 6;
 shape.ThreeDFormat.BevelTop.Width = 6;

Please confirm if I am missing something or doing something incorrectly?

leora
  • 188,729
  • 360
  • 878
  • 1,366

2 Answers2

2

I have worked with the sample code shared by you and have observed the generated presentation. The 3D properties for the shape are getting set in properties but are not reflecting visually unless it is manually updated one time from properties. It seems to be an issue in Aspose.Slides and I suggest you to please consult Aspose.Slides support forum in this regard to log an issue request for you.

www.aspose.com/community/forums/aspose.slides-product-family/109/showforum.aspx

NOTE: I am a support developer / evangelist at Aspose.

mhovd
  • 3,724
  • 2
  • 21
  • 47
Mudassir
  • 433
  • 2
  • 7
  • thanks Mudassir - i have posted on the forum. A question in general, is Stackoverflow a supported /recommended place to ask aspose.slides questions (in terms of it being monitored, etc) or do you prefer the forum. It seems like a lot of other companies are now encouraging moving to SOF so just want to confirm to avoid double posting in the future. – leora Oct 12 '15 at 15:20
  • Hi Leora, You can post the product related questions directly in respective product forums for expedite response. You can still post them here as well but in that case if there is some bug that is to be logged in system then you have to post in product forums as well. Also the respective product forums ensure expedite response. – Mudassir Oct 15 '15 at 07:42
2

You can correctly add the 3D bevel effect to a shape using Aspose.Slides for .NET as shown below:

using (var presentation = new Presentation())
{
    ISlide slide = presentation.Slides[0];

    IShape shape = slide.Shapes.AddAutoShape(ShapeType.Ellipse, 100, 100, 50, 50);
    shape.FillFormat.FillType = FillType.Solid;
    shape.FillFormat.SolidFillColor.Color = Color.Green;

    ILineFillFormat lineFillFormat = shape.LineFormat.FillFormat;
    lineFillFormat.FillType = FillType.Solid;
    lineFillFormat.SolidFillColor.Color = Color.Orange;
    shape.LineFormat.Width = 2.0;

    shape.ThreeDFormat.BevelTop.BevelType = BevelPresetType.Circle;
    shape.ThreeDFormat.BevelTop.Height = 6;
    shape.ThreeDFormat.BevelTop.Width = 6;

    //Add Camera, Light and Material
    shape.ThreeDFormat.Camera.CameraType = CameraPresetType.OrthographicFront;
    shape.ThreeDFormat.LightRig.LightType = LightRigPresetType.ThreePt;
    shape.ThreeDFormat.Material = MaterialPresetType.WarmMatte;

    presentation.Save("bevel.pptx", SaveFormat.Pptx);
}

Disclaimer: I work for Aspose

Jean-François Fabre
  • 137,073
  • 23
  • 153
  • 219
Andrey P.
  • 36
  • 2