Base class for ShapeRenderer and OfficeMathRenderer.
Shows how to measure and scale shapes.
#include <Aspose.Words.Cpp/Rendering/NodeRendererBase.h>
Public Member Functions | |
NodeRendererBase () | |
RectangleF | get_BoundsInPoints () const |
Gets the actual bounds of the shape in points. More... | |
RectangleF | get_OpaqueBoundsInPoints () |
Gets the opaque bounds of the shape in points. More... | |
SizeF | get_SizeInPoints () |
Gets the actual size of the shape in points. More... | |
Rectangle | GetBoundsInPixels (float scale, float dpi) |
Calculates the bounds of the shape in pixels for a specified zoom factor and resolution. More... | |
Rectangle | GetBoundsInPixels (float scale, float horizontalDpi, float verticalDpi) |
Calculates the bounds of the shape in pixels for a specified zoom factor and resolution. More... | |
Rectangle | GetOpaqueBoundsInPixels (float scale, float dpi) |
Calculates the opaque bounds of the shape in pixels for a specified zoom factor and resolution. More... | |
Rectangle | GetOpaqueBoundsInPixels (float scale, float horizontalDpi, float verticalDpi) |
Calculates the opaque bounds of the shape in pixels for a specified zoom factor and resolution. More... | |
Size | GetSizeInPixels (float scale, float dpi) |
Calculates the size of the shape in pixels for a specified zoom factor and resolution. More... | |
Size | GetSizeInPixels (float scale, float horizontalDpi, float verticalDpi) |
Calculates the size of the shape in pixels for a specified zoom factor and resolution. More... | |
virtual const TypeInfo & | GetType () const override |
virtual bool | Is (const TypeInfo &target) const override |
SizeF | RenderToScale (const SharedPtr< Graphics > &graphics, float x, float y, float scale) |
Renders the shape into a Graphics object to a specified scale. More... | |
float | RenderToSize (const SharedPtr< Graphics > &graphics, float x, float y, float width, float height) |
Renders the shape into a Graphics object to a specified size. More... | |
void | Save (const SharedPtr< Stream > &stream, SharedPtr< ImageSaveOptions > saveOptions) |
Renders the shape into an image and saves into a stream. More... | |
void | Save (const String &fileName, SharedPtr< ImageSaveOptions > saveOptions) |
Renders the shape into an image and saves into a file. More... | |
template<typename CharType , typename Traits > | |
void | Save (std::basic_ostream< CharType, Traits > &stream, SharedPtr< ImageSaveOptions > saveOptions) |
Static Public Member Functions | |
static const TypeInfo & | Type () |
Aspose::Words::Rendering::NodeRendererBase::NodeRendererBase | ( | ) |
System::Drawing::RectangleF Aspose::Words::Rendering::NodeRendererBase::get_BoundsInPoints | ( | ) | const |
Gets the actual bounds of the shape in points.
This property returns the actual (as rendered on the page) bounding box of the shape. The bounds takes into account shape rotation (if any).
Shows how to measure and scale shapes.
System::Drawing::RectangleF Aspose::Words::Rendering::NodeRendererBase::get_OpaqueBoundsInPoints | ( | ) |
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.
Shows how to measure and scale shapes.
System::Drawing::SizeF Aspose::Words::Rendering::NodeRendererBase::get_SizeInPoints | ( | ) |
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).
Shows how to measure and scale shapes.
System::Drawing::Rectangle Aspose::Words::Rendering::NodeRendererBase::GetBoundsInPixels | ( | float | scale, |
float | dpi | ||
) |
Calculates the bounds of the shape in pixels for a specified zoom factor and resolution.
This method converts BoundsInPoints into rectangle in pixels.
scale | The zoom factor (1.0 is 100%). |
dpi | The resolution (horizontal and vertical) to convert from points to pixels (dots per inch). |
Shows how to measure and scale shapes.
System::Drawing::Rectangle Aspose::Words::Rendering::NodeRendererBase::GetBoundsInPixels | ( | float | scale, |
float | horizontalDpi, | ||
float | verticalDpi | ||
) |
Calculates the bounds of the shape in pixels for a specified zoom factor and resolution.
This method converts BoundsInPoints into rectangle in pixels.
scale | The zoom factor (1.0 is 100%). |
horizontalDpi | The horizontal resolution to convert from points to pixels (dots per inch). |
verticalDpi | The vertical resolution to convert from points to pixels (dots per inch). |
Shows how to measure and scale shapes.
System::Drawing::Rectangle Aspose::Words::Rendering::NodeRendererBase::GetOpaqueBoundsInPixels | ( | float | scale, |
float | dpi | ||
) |
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.
scale | The zoom factor (1.0 is 100%). |
dpi | The resolution to convert from points to pixels (dots per inch). |
Shows how to measure and scale shapes.
System::Drawing::Rectangle Aspose::Words::Rendering::NodeRendererBase::GetOpaqueBoundsInPixels | ( | float | scale, |
float | horizontalDpi, | ||
float | verticalDpi | ||
) |
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.
scale | The zoom factor (1.0 is 100%). |
horizontalDpi | The horizontal resolution to convert from points to pixels (dots per inch). |
verticalDpi | The vertical resolution to convert from points to pixels (dots per inch). |
Shows how to measure and scale shapes.
System::Drawing::Size Aspose::Words::Rendering::NodeRendererBase::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.
scale | The zoom factor (1.0 is 100%). |
dpi | The resolution (horizontal and vertical) to convert from points to pixels (dots per inch). |
Shows how to measure and scale shapes.
System::Drawing::Size Aspose::Words::Rendering::NodeRendererBase::GetSizeInPixels | ( | float | scale, |
float | horizontalDpi, | ||
float | verticalDpi | ||
) |
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.
scale | The zoom factor (1.0 is 100%). |
horizontalDpi | The horizontal resolution to convert from points to pixels (dots per inch). |
verticalDpi | The vertical resolution to convert from points to pixels (dots per inch). |
Shows how to measure and scale shapes.
|
overridevirtual |
Reimplemented from System::Object.
Reimplemented in Aspose::Words::Rendering::OfficeMathRenderer, and Aspose::Words::Rendering::ShapeRenderer.
|
overridevirtual |
Reimplemented from System::Object.
Reimplemented in Aspose::Words::Rendering::OfficeMathRenderer, and Aspose::Words::Rendering::ShapeRenderer.
System::Drawing::SizeF Aspose::Words::Rendering::NodeRendererBase::RenderToScale | ( | const System::SharedPtr< System::Drawing::Graphics > & | graphics, |
float | x, | ||
float | y, | ||
float | scale | ||
) |
Renders the shape into a Graphics object to a specified scale.
graphics | The object where to render to. |
x | The X coordinate (in world units) of the top left corner of the rendered shape. |
y | The Y coordinate (in world units) of the top left corner of the rendered shape. |
scale | The scale for rendering the shape (1.0 is 100%). |
float Aspose::Words::Rendering::NodeRendererBase::RenderToSize | ( | const System::SharedPtr< System::Drawing::Graphics > & | graphics, |
float | x, | ||
float | y, | ||
float | width, | ||
float | height | ||
) |
Renders the shape into a Graphics object to a specified size.
graphics | The object where to render to. |
x | The X coordinate (in world units) of the top left corner of the rendered shape. |
y | The Y coordinate (in world units) of the top left corner of the rendered shape. |
width | The maximum width (in world units) that can be occupied by the rendered shape. |
height | The maximum height (in world units) that can be occupied by the rendered shape. |
void Aspose::Words::Rendering::NodeRendererBase::Save | ( | const System::SharedPtr< System::IO::Stream > & | stream, |
System::SharedPtr< Aspose::Words::Saving::ImageSaveOptions > | saveOptions | ||
) |
Renders the shape into an image and saves into a stream.
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. |
Shows how to use a shape renderer to export shapes to files in the local file system.
void Aspose::Words::Rendering::NodeRendererBase::Save | ( | const System::String & | fileName, |
System::SharedPtr< Aspose::Words::Saving::ImageSaveOptions > | saveOptions | ||
) |
Renders the shape into an image and saves into a file.
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. |
Shows how to render an Office Math object into an image file in the local file system.
|
inline |
|
static |