如何在 .net aspose.slides 形状中获得 3d 斜角?
How do you get 3d bevels working in .net aspose.slides shapes?
我正在尝试以编程方式向形状添加斜面 3d 效果using aspose.slides,但它似乎不起作用。
奇怪的是,当我实际进入 powerpoint 并单击 "Format Shape" 时,似乎我在下面设置的所有设置都已设置,但我没有看到任何 3d 效果(请参阅我的照片如下)。如果在 powerpoint 中单击任何设置(即使重新单击已经设置为 BevelTop = circle 的设置,它也会在此时生效。
我是不是在下面做错了什么?
我附上了一张图片来帮助说明这个问题。
左边是我试图用我的代码创建的东西,图片的右边是实际显示的东西。下面是我的代码
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;
请确认我是否遗漏了什么或做错了什么?
我已经使用了您共享的示例代码并观察了生成的演示文稿。形状的 3D 属性在属性中设置,但不会在视觉上反映出来,除非从属性中手动更新一次。这似乎是 Aspose.Slides 中的一个问题,我建议您在这方面咨询 Aspose.Slides 支持论坛,以便为您记录一个问题请求。
www.aspose.com/community/forums/aspose.slides-product-family/109/showforum.aspx
注意:我是 Aspose 的支持开发人员/传道者。
您可以使用 Aspose.Slides for .NET 正确地将 3D 斜角效果添加到形状,如下所示:
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);
}
免责声明:我为 Aspose 工作
我正在尝试以编程方式向形状添加斜面 3d 效果using aspose.slides,但它似乎不起作用。
奇怪的是,当我实际进入 powerpoint 并单击 "Format Shape" 时,似乎我在下面设置的所有设置都已设置,但我没有看到任何 3d 效果(请参阅我的照片如下)。如果在 powerpoint 中单击任何设置(即使重新单击已经设置为 BevelTop = circle 的设置,它也会在此时生效。
我是不是在下面做错了什么?
我附上了一张图片来帮助说明这个问题。
左边是我试图用我的代码创建的东西,图片的右边是实际显示的东西。下面是我的代码
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;
请确认我是否遗漏了什么或做错了什么?
我已经使用了您共享的示例代码并观察了生成的演示文稿。形状的 3D 属性在属性中设置,但不会在视觉上反映出来,除非从属性中手动更新一次。这似乎是 Aspose.Slides 中的一个问题,我建议您在这方面咨询 Aspose.Slides 支持论坛,以便为您记录一个问题请求。
www.aspose.com/community/forums/aspose.slides-product-family/109/showforum.aspx
注意:我是 Aspose 的支持开发人员/传道者。
您可以使用 Aspose.Slides for .NET 正确地将 3D 斜角效果添加到形状,如下所示:
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);
}
免责声明:我为 Aspose 工作