public final class ThreeDFormat extends PVIObject implements IThreeDFormat, IThreeDParamSource
Represents 3-D properties.
The following example shows how to add 3D shape in PowerPoint Presentation.// Create an instance of Presentation class. Presentation pres = new Presentation(); try { // Add a shape using AddAutoShape method IAutoShape shape = pres.getSlides().get_Item(0).getShapes().addAutoShape(ShapeType.Rectangle, 200, 150, 200, 200); // Define TextFrame and its properties shape.getTextFrame().setText("3D"); shape.getTextFrame().getParagraphs().get_Item(0).getParagraphFormat().getDefaultPortionFormat().setFontHeight(64); // Define ThreeDFormat Properties shape.getThreeDFormat().getCamera().setCameraType(CameraPresetType.OrthographicFront); shape.getThreeDFormat().getCamera().setRotation(20, 30, 40); shape.getThreeDFormat().getLightRig().setLightType(LightRigPresetType.Flat); shape.getThreeDFormat().getLightRig().setDirection(LightingDirection.Top); shape.getThreeDFormat().setMaterial(MaterialPresetType.Flat); shape.getThreeDFormat().setExtrusionHeight(100); shape.getThreeDFormat().getExtrusionColor().setColor(Color.BLUE); // Save the Presentation file pres.save("sandbox_3d.pptx", SaveFormat.Pptx); } finally { if (pres != null) pres.dispose(); }The following example shows how to apply Gradient affect to 3D shape in PowerPoint Presentation.// Create an instance of Presentation class. Presentation pres = new Presentation(); try { // Add a shape using AddAutoShape method IAutoShape shape = pres.getSlides().get_Item(0).getShapes().addAutoShape(ShapeType.Rectangle, 200, 150, 250, 250); // Define TextFrame and its properties shape.getTextFrame().setText("3D Gradient"); shape.getTextFrame().getParagraphs().get_Item(0).getParagraphFormat().getDefaultPortionFormat().setFontHeight(64); // Configure FillFormat.FillType as FillType.Gradient and define gradient properties shape.getFillFormat().setFillType(FillType.Gradient); shape.getFillFormat().getGradientFormat().getGradientStops().add(0, Color.BLUE); shape.getFillFormat().getGradientFormat().getGradientStops().add(100, Color.ORANGE); // Define ThreeDFormat Properties shape.getThreeDFormat().getCamera().setCameraType(CameraPresetType.OrthographicFront); shape.getThreeDFormat().getCamera().setRotation(20, 30, 40); shape.getThreeDFormat().getLightRig().setLightType(LightRigPresetType.Flat); shape.getThreeDFormat().getLightRig().setDirection(LightingDirection.Top); shape.getThreeDFormat().setMaterial(MaterialPresetType.Flat); shape.getThreeDFormat().setExtrusionHeight(100); shape.getThreeDFormat().getExtrusionColor().setColor(Color.BLUE); // Save the Presentation file pres.save("sandbox_3d.pptx", SaveFormat.Pptx); } finally { if (pres != null) pres.dispose(); }The following example shows how to apply 3D effect on text. For creating a 3D text its possible to use WordArt transform effect.// Create an instance of Presentation class. Presentation pres = new Presentation(); try { // Add a shape using AddAutoShape method IAutoShape shape = pres.getSlides().get_Item(0).getShapes().addAutoShape(ShapeType.Rectangle, 200, 150, 250, 250); // Define TextFrame and its properties shape.getTextFrame().setText("3D Text"); // Configure FillFormat.FillType as FillType.NoFill shape.getFillFormat().setFillType(FillType.NoFill); shape.getLineFormat().getFillFormat().setFillType(FillType.NoFill); // Configure Portion of TextFrame and configure properties of PortionFormat Portion portion = (Portion)shape.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0); portion.getPortionFormat().getFillFormat().setFillType(FillType.Pattern); portion.getPortionFormat().getFillFormat().getPatternFormat().getForeColor().setColor(Color.ORANGE); portion.getPortionFormat().getFillFormat().getPatternFormat().getBackColor().setColor(Color.WHITE); portion.getPortionFormat().getFillFormat().getPatternFormat().setPatternStyle(PatternStyle.LargeGrid); shape.getTextFrame().getParagraphs().get_Item(0).getParagraphFormat().getDefaultPortionFormat().setFontHeight(128); ITextFrame textFrame = shape.getTextFrame(); // setup "Arch Up" WordArt transform effect textFrame.getTextFrameFormat().setTransform(TextShapeType.ArchUp); // Define ThreeDFormat Properties of ITextFrame textFrame.getTextFrameFormat().getThreeDFormat().setExtrusionHeight(3.5f); textFrame.getTextFrameFormat().getThreeDFormat().setDepth(3); textFrame.getTextFrameFormat().getThreeDFormat().setMaterial(MaterialPresetType.Plastic); textFrame.getTextFrameFormat().getThreeDFormat().getLightRig().setDirection(LightingDirection.Top); textFrame.getTextFrameFormat().getThreeDFormat().getLightRig().setLightType(LightRigPresetType.Balanced); textFrame.getTextFrameFormat().getThreeDFormat().getLightRig().setRotation(0, 0, 40); textFrame.getTextFrameFormat().getThreeDFormat().getCamera().setCameraType(CameraPresetType.PerspectiveContrastingRightFacing); // Save the Presentation file pres.save("text3d.pptx", SaveFormat.Pptx); } finally { if (pres != null) pres.dispose(); }
| Modifier and Type | Method and Description |
|---|---|
IShapeBevel |
getBevelBottom()
Returns or sets the type of a bottom 3D bevel.
|
IShapeBevel |
getBevelTop()
Returns or sets the type of a top 3D bevel.
|
ICamera |
getCamera()
Returns or sets the settings of a camera.
|
IColorFormat |
getContourColor()
Returns or sets the color of a contour.
|
double |
getContourWidth()
Returns or sets the width of a 3D contour.
|
double |
getDepth()
Returns or sets the depth of a 3D shape.
|
IThreeDFormatEffectiveData |
getEffective()
Gets effective 3-D formatting data with the inheritance applied.
|
IColorFormat |
getExtrusionColor()
Returns or sets the color of an extrusion.
|
double |
getExtrusionHeight()
Returns or sets the height of an extrusion effect.
|
ILightRig |
getLightRig()
Returns or sets the type of a light.
|
int |
getMaterial()
Returns or sets the type of a material.
|
long |
getVersion()
Version.
|
void |
setContourWidth(double value)
Returns or sets the width of a 3D contour.
|
void |
setDepth(double value)
Returns or sets the depth of a 3D shape.
|
void |
setExtrusionHeight(double value)
Returns or sets the height of an extrusion effect.
|
void |
setMaterial(int value)
Returns or sets the type of a material.
|
equals, getParent_Immediate, getParent_IPresentationComponent, getParent_ISlideComponent, getPresentation, getSlide, hashCodepublic long getVersion()
Version.
Read-only long.
getVersion in class PVIObjectpublic final double getContourWidth()
Returns or sets the width of a 3D contour.
Read/write double.
getContourWidth in interface IThreeDFormatpublic final void setContourWidth(double value)
Returns or sets the width of a 3D contour.
Read/write double.
setContourWidth in interface IThreeDFormatpublic final double getExtrusionHeight()
Returns or sets the height of an extrusion effect.
Read/write double.
getExtrusionHeight in interface IThreeDFormatpublic final void setExtrusionHeight(double value)
Returns or sets the height of an extrusion effect.
Read/write double.
setExtrusionHeight in interface IThreeDFormatpublic final double getDepth()
Returns or sets the depth of a 3D shape.
Read/write double.
getDepth in interface IThreeDFormatpublic final void setDepth(double value)
Returns or sets the depth of a 3D shape.
Read/write double.
setDepth in interface IThreeDFormatpublic final IShapeBevel getBevelTop()
Returns or sets the type of a top 3D bevel.
Read-only IShapeBevel.
getBevelTop in interface IThreeDFormatpublic final IShapeBevel getBevelBottom()
Returns or sets the type of a bottom 3D bevel.
Read-only IShapeBevel.
getBevelBottom in interface IThreeDFormatpublic final IColorFormat getContourColor()
Returns or sets the color of a contour.
Read-only IColorFormat.
getContourColor in interface IThreeDFormatpublic final IColorFormat getExtrusionColor()
Returns or sets the color of an extrusion.
Read-only IColorFormat.
getExtrusionColor in interface IThreeDFormatpublic final ICamera getCamera()
Returns or sets the settings of a camera.
Read-only ICamera.
getCamera in interface IThreeDFormatpublic final ILightRig getLightRig()
Returns or sets the type of a light.
Read-only ILightRig.
getLightRig in interface IThreeDFormatpublic final int getMaterial()
Returns or sets the type of a material.
Read/write MaterialPresetType.
getMaterial in interface IThreeDFormatpublic final void setMaterial(int value)
Returns or sets the type of a material.
Read/write MaterialPresetType.
setMaterial in interface IThreeDFormatpublic final IThreeDFormatEffectiveData getEffective()
Gets effective 3-D formatting data with the inheritance applied.
This example demonstrates how to get effective properties for camera, light rig and shape's top bevel.Presentation pres = new Presentation("MyPresentation.pptx"); try { IThreeDFormatEffectiveData threeDEffectiveData = pres.getSlides().get_Item(0).getShapes().get_Item(0).getThreeDFormat().getEffective(); System.out.println("= Effective camera properties ="); System.out.println("Type: " + threeDEffectiveData.getCamera().getCameraType()); System.out.println("Field of view: " + threeDEffectiveData.getCamera().getFieldOfViewAngle()); System.out.println("Zoom: " + threeDEffectiveData.getCamera().getZoom()); System.out.println("= Effective light rig properties ="); System.out.println("Type: " + threeDEffectiveData.getLightRig().getLightType()); System.out.println("Direction: " + threeDEffectiveData.getLightRig().getDirection()); System.out.println("= Effective shape's top face relief properties ="); System.out.println("Type: " + threeDEffectiveData.getBevelTop().getBevelType()); System.out.println("Width: " + threeDEffectiveData.getBevelTop().getWidth()); System.out.println("Height: " + threeDEffectiveData.getBevelTop().getHeight()); } finally { if (pres != null) pres.dispose(); }
getEffective in interface IThreeDFormatIThreeDFormatEffectiveData.Copyright © 2004-2025 Aspose Pty Ltd. All Rights Reserved.