ShapeRenderer Class |
Namespace: Aspose.Words.Rendering
The ShapeRenderer type exposes the following members.
Name | Description | |
---|---|---|
![]() ![]() | ShapeRenderer |
Initializes a new instance of this class.
|
Name | Description | |
---|---|---|
![]() ![]() | BoundsInPoints |
Gets the actual bounds of the shape in points.
(Inherited from NodeRendererBase.) |
![]() ![]() | OpaqueBoundsInPoints |
Gets the opaque bounds of the shape in points.
(Inherited from NodeRendererBase.) |
![]() ![]() | SizeInPoints |
Gets the actual size of the shape in points.
(Inherited from NodeRendererBase.) |
Name | Description | |
---|---|---|
![]() | Equals | (Inherited from Object.) |
![]() ![]() | GetBoundsInPixels(Single, Single) |
Calculates the bounds of the shape in pixels for a specified zoom factor and resolution.
(Inherited from NodeRendererBase.) |
![]() ![]() | GetBoundsInPixels(Single, Single, Single) |
Calculates the bounds of the shape in pixels for a specified zoom factor and resolution.
(Inherited from NodeRendererBase.) |
![]() | GetHashCode | (Inherited from Object.) |
![]() ![]() | GetOpaqueBoundsInPixels(Single, Single) |
Calculates the opaque bounds of the shape in pixels for a specified zoom factor and resolution.
(Inherited from NodeRendererBase.) |
![]() ![]() | GetOpaqueBoundsInPixels(Single, Single, Single) |
Calculates the opaque bounds of the shape in pixels for a specified zoom factor and resolution.
(Inherited from NodeRendererBase.) |
![]() ![]() | GetSizeInPixels(Single, Single) |
Calculates the size of the shape in pixels for a specified zoom factor and resolution.
(Inherited from NodeRendererBase.) |
![]() ![]() | GetSizeInPixels(Single, Single, Single) |
Calculates the size of the shape in pixels for a specified zoom factor and resolution.
(Inherited from NodeRendererBase.) |
![]() | GetType | (Inherited from Object.) |
![]() ![]() | RenderToScale |
Renders the shape into a Graphics
object to a specified scale.
(Inherited from NodeRendererBase.) |
![]() ![]() | RenderToSize |
Renders the shape into a Graphics
object to a specified size.
(Inherited from NodeRendererBase.) |
![]() ![]() | Save(Stream, ImageSaveOptions) |
Renders the shape into an image and saves into a stream.
(Inherited from NodeRendererBase.) |
![]() ![]() | Save(String, ImageSaveOptions) |
Renders the shape into an image and saves into a file.
(Inherited from NodeRendererBase.) |
![]() | ToString | (Inherited from Object.) |
public void DisplayShapeForm() { // Create a new ShapeForm instance and show it as a dialog box ShapeForm shapeForm = new ShapeForm(); shapeForm.ShowDialog(); } /// <summary> /// Windows Form that renders and displays shapes from a document. /// </summary> private class ShapeForm : Form { protected override void OnPaint(PaintEventArgs e) { // Set the size of the Form canvas Size = new Size(1000, 800); // Open a document and get its first shape, which is a chart Document doc = new Document(MyDir + "Various shapes.docx"); Shape shape = (Shape)doc.GetChild(NodeType.Shape, 1, true); // Create a ShapeRenderer instance and a Graphics object // The ShapeRenderer will render the shape that is passed during construction over the Graphics object // Whatever is rendered on this Graphics object will be displayed on the screen inside this form ShapeRenderer renderer = new ShapeRenderer(shape); Graphics formGraphics = CreateGraphics(); // Call this method on the renderer to render the chart in the passed Graphics object, // on a specified x/y coordinate and scale renderer.RenderToScale(formGraphics, 0, 0, 1.5f); // Get another shape from the document, and render it to a specific size instead of a linear scale GroupShape groupShape = (GroupShape)doc.GetChild(NodeType.GroupShape, 0, true); renderer = new ShapeRenderer(groupShape); renderer.RenderToSize(formGraphics, 500, 400, 100, 200); } }