NodeRendererBase Class |
Namespace: Aspose.Words.Rendering
The NodeRendererBase type exposes the following members.
Name | Description | |
---|---|---|
![]() ![]() | BoundsInPoints |
Gets the actual bounds of the shape in points.
|
![]() ![]() | OpaqueBoundsInPoints |
Gets the opaque bounds of the shape in points.
|
![]() ![]() | SizeInPoints |
Gets the actual size of the shape in points.
|
Name | Description | |
---|---|---|
![]() | Equals | (Inherited from Object.) |
![]() ![]() | GetBoundsInPixels(Single, Single) |
Calculates the bounds of the shape in pixels for a specified zoom factor and resolution.
|
![]() ![]() | GetBoundsInPixels(Single, Single, Single) |
Calculates the bounds of the shape in pixels for a specified zoom factor and resolution.
|
![]() | GetHashCode | (Inherited from Object.) |
![]() ![]() | GetOpaqueBoundsInPixels(Single, Single) |
Calculates the opaque bounds of the shape in pixels for a specified zoom factor and resolution.
|
![]() ![]() | GetOpaqueBoundsInPixels(Single, Single, Single) |
Calculates the opaque bounds of the shape in pixels for a specified zoom factor and resolution.
|
![]() ![]() | GetSizeInPixels(Single, Single) |
Calculates the size of the shape in pixels for a specified zoom factor and resolution.
|
![]() ![]() | GetSizeInPixels(Single, Single, Single) |
Calculates the size of the shape in pixels for a specified zoom factor and resolution.
|
![]() | GetType | (Inherited from Object.) |
![]() ![]() | RenderToScale |
Renders the shape into a Graphics
object to a specified scale.
|
![]() ![]() | RenderToSize |
Renders the shape into a Graphics
object to a specified size.
|
![]() ![]() | Save(Stream, ImageSaveOptions) |
Renders the shape into an image and saves into a stream.
|
![]() ![]() | Save(String, ImageSaveOptions) |
Renders the shape into an image and saves into a file.
|
![]() | ToString | (Inherited from Object.) |
// Open a document that contains an OfficeMath object Document doc = new Document(MyDir + "Office math.docx"); // Create a renderer for the OfficeMath object OfficeMath officeMath = (OfficeMath)doc.GetChild(NodeType.OfficeMath, 0, true); OfficeMathRenderer renderer = new OfficeMathRenderer(officeMath); // We can measure the size of the image that the OfficeMath object will create when we render it Assert.AreEqual(117.0f, renderer.SizeInPoints.Width, 0.1f); Assert.AreEqual(12.9f, renderer.SizeInPoints.Height, 0.1f); Assert.AreEqual(117.0f, renderer.BoundsInPoints.Width, 0.1f); Assert.AreEqual(12.9f, renderer.BoundsInPoints.Height, 0.1f); // Shapes with transparent parts may return different values here Assert.AreEqual(117.0f, renderer.OpaqueBoundsInPoints.Width, 0.1f); Assert.AreEqual(14.7f, renderer.OpaqueBoundsInPoints.Height, 0.1f); // Get the shape size in pixels, with linear scaling to a specific DPI Rectangle bounds = renderer.GetBoundsInPixels(1.0f, 96.0f); Assert.AreEqual(156, bounds.Width); Assert.AreEqual(18, bounds.Height); // Get the shape size in pixels, but with a different DPI for the horizontal and vertical dimensions bounds = renderer.GetBoundsInPixels(1.0f, 96.0f, 150.0f); Assert.AreEqual(156, bounds.Width); Assert.AreEqual(27, bounds.Height); // The opaque bounds may vary here also bounds = renderer.GetOpaqueBoundsInPixels(1.0f, 96.0f); Assert.AreEqual(156, bounds.Width); Assert.AreEqual(20, bounds.Height); bounds = renderer.GetOpaqueBoundsInPixels(1.0f, 96.0f, 150.0f); Assert.AreEqual(156, bounds.Width); Assert.AreEqual(31, bounds.Height);