ThreeDFormat — Aspose.Slides FOSS for Java API Reference
The ThreeDFormat class represents 3-D formatting properties for a shape. It extends PVIObject and implements IThreeDFormat and IThreeDParamSource.
Package: org.aspose.slides.foss
import org.aspose.slides.foss.*;public class ThreeDFormat extends PVIObject implements IThreeDFormat, IThreeDParamSourceProperties
| Property | Type | Access | Description |
|---|---|---|---|
getBevelTop() | IShapeBevel | Read | Top bevel settings. |
getBevelBottom() | IShapeBevel | Read | Bottom bevel settings. |
getContourWidth() / setContourWidth(double) | double | Read/Write | Contour width in points. |
getContourColor() | IColorFormat | Read | Contour color. |
getExtrusionHeight() / setExtrusionHeight(double) | double | Read/Write | Extrusion height in points. |
getExtrusionColor() | IColorFormat | Read | Extrusion color. |
getDepth() / setDepth(double) | double | Read/Write | Depth of the 3-D effect. |
getCamera() | ICamera | Read | Camera settings. |
getLightRig() | ILightRig | Read | Lighting settings. |
getMaterial() / setMaterial(MaterialPresetType) | MaterialPresetType | Read/Write | Material preset (matte, plastic, metal, etc.). |
Usage Examples
Apply 3-D Effect to a Shape
import org.aspose.slides.foss.*;
Presentation prs = new Presentation();
IAutoShape shape = prs.getSlides().get(0).getShapes()
.addAutoShape(ShapeType.RECTANGLE, 50, 50, 200, 100);
IThreeDFormat threeD = shape.getThreeDFormat();
threeD.setDepth(10.0);
threeD.setExtrusionHeight(5.0);
threeD.setMaterial(MaterialPresetType.WARM_MATTE);
prs.save("3d-shape.pptx", SaveFormat.PPTX);Read 3-D Properties
IThreeDFormat threeD = shape.getThreeDFormat();
System.out.println("Depth: " + threeD.getDepth());
System.out.println("Material: " + threeD.getMaterial());
IShapeBevel topBevel = threeD.getBevelTop();
ICamera camera = threeD.getCamera();
ILightRig light = threeD.getLightRig();