com.aspose.words
Class ShapeRenderer

java.lang.Object
  extended by NodeRendererBase
      extended by com.aspose.words.ShapeRenderer

public class ShapeRenderer 
extends NodeRendererBase

Provides methods to render an individual Shape or GroupShape to a raster or vector image or to a Graphics object.

Constructor Summary
ShapeRenderer(ShapeBase shape)
           Initializes a new instance of this class.
 
Property Getters/Setters Summary
java.awt.geom.Rectangle2D.FloatgetOpaqueBoundsInPoints()→ inherited from NodeRendererBase
           Gets the opaque bounds of the shape in points.
java.awt.DimensiongetSizeInPoints()→ inherited from NodeRendererBase
           Gets the actual size of the shape in points.
 
Method Summary
java.awt.RectanglegetBoundsInPixels(float scale, float dpi)→ inherited from NodeRendererBase
           Calculates the bounds of the shape in pixels for a specified zoom factor and resolution.
java.awt.RectanglegetBoundsInPixels(float scale, float horizontalDpi, float verticalDpi)→ inherited from NodeRendererBase
          
java.awt.RectanglegetOpaqueBoundsInPixels(float scale, float dpi)→ inherited from NodeRendererBase
           Calculates the opaque bounds of the shape in pixels for a specified zoom factor and resolution.
java.awt.RectanglegetOpaqueBoundsInPixels(float scale, float horizontalDpi, float verticalDpi)→ inherited from NodeRendererBase
          
java.awt.DimensiongetSizeInPixels(float scale, float dpi)→ inherited from NodeRendererBase
           Calculates the size of the shape in pixels for a specified zoom factor and resolution.
java.awt.DimensiongetSizeInPixels(float scale, float horizontalDpi, float verticalDpi)→ inherited from NodeRendererBase
          
voidsave(java.io.OutputStream stream, ImageSaveOptions saveOptions)→ inherited from NodeRendererBase
           Renders the shape into an image and saves into a stream.
voidsave(java.lang.String fileName, ImageSaveOptions saveOptions)→ inherited from NodeRendererBase
           Renders the shape into an image and saves into a file.
 

Constructor Detail

ShapeRenderer

public ShapeRenderer(ShapeBase shape)
              throws java.lang.Exception
Initializes a new instance of this class.
Parameters:
shape - The DrawinML shape object that you want to render.

Property Getters/Setters Detail

getOpaqueBoundsInPoints

→ inherited from NodeRendererBase
public java.awt.geom.Rectangle2D.Float getOpaqueBoundsInPoints()
Gets the opaque bounds of the shape in points.

This property returns the opaque (i.e. transparent parts of the shape are ignored) bounding box of the shape. The bounds takes the shape rotation into account.


getSizeInPoints

→ inherited from NodeRendererBase
public java.awt.Dimension getSizeInPoints()
Gets the actual size of the shape in points.

This property returns the size of the actual (as rendered on the page) bounding box of the shape. The size takes into account shape rotation (if any).


Method Detail

getBoundsInPixels

→ inherited from NodeRendererBase
public java.awt.Rectangle getBoundsInPixels(float scale, float dpi)
Calculates the bounds of the shape in pixels for a specified zoom factor and resolution.

This method converts #Error Cref: P:Aspose.Words.Rendering.NodeRendererBase.BoundsInPoints into rectangle in pixels.

Parameters:
scale - The zoom factor (1.0 is 100%).
dpi - The resolution to convert from points to pixels (dots per inch).
Returns:
The actual (as rendered on the page) bounding box of the shape in pixels.

getBoundsInPixels

→ inherited from NodeRendererBase
public java.awt.Rectangle getBoundsInPixels(float scale, float horizontalDpi, float verticalDpi)

getOpaqueBoundsInPixels

→ inherited from NodeRendererBase
public java.awt.Rectangle getOpaqueBoundsInPixels(float scale, float dpi)
                                 throws java.lang.Exception
Calculates the opaque bounds of the shape in pixels for a specified zoom factor and resolution.

This method converts OpaqueBoundsInPoints into rectangle in pixels and it is useful when you want to create a bitmap for rendering the shape with only opaque part of the shape.

Parameters:
scale - The zoom factor (1.0 is 100%).
dpi - The resolution to convert from points to pixels (dots per inch).
Returns:
The opaque rectangle of the shape in pixels.

getOpaqueBoundsInPixels

→ inherited from NodeRendererBase
public java.awt.Rectangle getOpaqueBoundsInPixels(float scale, float horizontalDpi, float verticalDpi)
                                 throws java.lang.Exception

getSizeInPixels

→ inherited from NodeRendererBase
public java.awt.Dimension getSizeInPixels(float scale, float dpi)
Calculates the size of the shape in pixels for a specified zoom factor and resolution.

This method converts SizeInPoints into size in pixels and it is useful when you want to create a bitmap for rendering the shape neatly onto the bitmap.

Parameters:
scale - The zoom factor (1.0 is 100%).
dpi - The resolution to convert from points to pixels (dots per inch).
Returns:
The size of the shape in pixels.

getSizeInPixels

→ inherited from NodeRendererBase
public java.awt.Dimension getSizeInPixels(float scale, float horizontalDpi, float verticalDpi)

save

→ inherited from NodeRendererBase
public void save(java.io.OutputStream stream, ImageSaveOptions saveOptions)
         throws java.lang.Exception
Renders the shape into an image and saves into a stream.
Parameters:
stream - The stream where to save the image of the shape.
saveOptions - Specifies the options that control how the shape is rendered and saved. Can be null. If this is null, the image will be saved in the PNG format.

save

→ inherited from NodeRendererBase
public void save(java.lang.String fileName, ImageSaveOptions saveOptions)
         throws java.lang.Exception
Renders the shape into an image and saves into a file.
Parameters:
fileName - The name for the image file. If a file with the specified name already exists, the existing file is overwritten.
saveOptions - Specifies the options that control how the shape is rendered and saved. Can be null.

See Also:
          Aspose.Words Documentation - the home page for the Aspose.Words Product Documentation.
          Aspose.Words Support Forum - our preferred method of support.