Aspose::Words::Rendering::NodeRendererBase Class Reference

Detailed Description

Base class for ShapeRenderer and OfficeMathRenderer.

#include <Aspose.Words.Cpp/Rendering/NodeRendererBase.h>

+ Inheritance diagram for Aspose::Words::Rendering::NodeRendererBase:

Public Member Functions

 NodeRendererBase ()
 
RectangleF get_BoundsInPoints ()
 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...
 
SizeF RenderToScale (SharedPtr< Graphics > graphics, float x, float y, float scale)
 Renders the shape into a Graphics object to a specified scale. More...
 
float RenderToSize (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 (SharedPtr< Stream > stream, SharedPtr< ImageSaveOptions > saveOptions)
 Renders the shape into an image and saves into a stream. More...
 
void Save (String fileName, SharedPtr< ImageSaveOptions > saveOptions)
 Renders the shape into an image and saves into a file. More...
 
- Public Member Functions inherited from Object
ASPOSECPP_SHARED_API Object ()
 
ASPOSECPP_SHARED_API Object (Object const &x)
 
virtual ASPOSECPP_SHARED_API ~Object ()
 
virtual ASPOSECPP_SHARED_API bool Equals (ptr obj)
 
Detail::SmartPtrCounter * GetCounter ()
 
virtual ASPOSECPP_SHARED_API int GetHashCode () const
 
virtual ASPOSECPP_SHARED_API const TypeInfoGetType () const
 
virtual ASPOSECPP_SHARED_API bool Is (const TypeInfo &targetType) const
 
ASPOSECPP_SHARED_API void Lock ()
 
virtual ASPOSECPP_SHARED_API ptr MemberwiseClone () const
 
Objectoperator= (Object const &x)
 
bool ReferenceEquals (String const &str, std::nullptr_t)
 
bool ReferenceEquals (String const &str1, String const &str2)
 
int RemovedSharedRefs (int count)
 
virtual ASPOSECPP_SHARED_API void SetTemplateWeakPtr (unsigned int argument)
 
int SharedCount () const
 
ObjectSharedRefAdded ()
 
int SharedRefRemovedSafe ()
 
virtual ASPOSECPP_SHARED_API String ToString () const
 
ASPOSECPP_SHARED_API void Unlock ()
 
Detail::SmartPtrCounter * WeakRefAdded ()
 
void WeakRefRemoved ()
 

Additional Inherited Members

- Public Types inherited from Object
typedef SmartPtr< Objectptr
 
typedef System::Details::SharedMembersType shared_members_type
 
- Static Public Member Functions inherited from Object
bool Equals (double const &objA, double const &objB)
 
bool Equals (float const &objA, float const &objB)
 
static std::enable_if<!IsSmartPtr< T1 >::value &&!IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 
static std::enable_if< IsSmartPtr< T1 >::value &&IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 
static bool ReferenceEquals (ptr const &objA, ptr const &objB)
 
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, std::nullptr_t)
 
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, T const &objB)
 
static const TypeInfoType ()
 

Constructor & Destructor Documentation

◆ NodeRendererBase()

Aspose::Words::Rendering::NodeRendererBase::NodeRendererBase ( )

Member Function Documentation

◆ get_BoundsInPoints()

System::Drawing::RectangleF Aspose::Words::Rendering::NodeRendererBase::get_BoundsInPoints ( )

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).

◆ get_OpaqueBoundsInPoints()

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.

◆ get_SizeInPoints()

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).

◆ GetBoundsInPixels() [1/2]

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.

Parameters
scaleThe zoom factor (1.0 is 100%).
dpiThe resolution (horizontal and vertical) 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() [2/2]

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.

Parameters
scaleThe zoom factor (1.0 is 100%).
horizontalDpiThe horizontal resolution to convert from points to pixels (dots per inch).
verticalDpiThe vertical 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.

◆ GetOpaqueBoundsInPixels() [1/2]

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.

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

◆ GetOpaqueBoundsInPixels() [2/2]

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.

Parameters
scaleThe zoom factor (1.0 is 100%).
horizontalDpiThe horizontal resolution to convert from points to pixels (dots per inch).
verticalDpiThe vertical resolution to convert from points to pixels (dots per inch).
Returns
The opaque rectangle of the shape in pixels.

◆ GetSizeInPixels() [1/2]

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.

Parameters
scaleThe zoom factor (1.0 is 100%).
dpiThe resolution (horizontal and vertical) to convert from points to pixels (dots per inch).
Returns
The size of the shape in pixels.

◆ GetSizeInPixels() [2/2]

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.

Parameters
scaleThe zoom factor (1.0 is 100%).
horizontalDpiThe horizontal resolution to convert from points to pixels (dots per inch).
verticalDpiThe vertical resolution to convert from points to pixels (dots per inch).
Returns
The size of the shape in pixels.

◆ RenderToScale()

System::Drawing::SizeF Aspose::Words::Rendering::NodeRendererBase::RenderToScale ( System::SharedPtr< System::Drawing::Graphics graphics,
float  x,
float  y,
float  scale 
)

Renders the shape into a Graphics object to a specified scale.

Parameters
graphicsThe object where to render to.
xThe X coordinate (in world units) of the top left corner of the rendered shape.
yThe Y coordinate (in world units) of the top left corner of the rendered shape.
scaleThe scale for rendering the shape (1.0 is 100%).
Returns
The width and height (in world units) of the rendered shape.

◆ RenderToSize()

float Aspose::Words::Rendering::NodeRendererBase::RenderToSize ( 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.

Parameters
graphicsThe object where to render to.
xThe X coordinate (in world units) of the top left corner of the rendered shape.
yThe Y coordinate (in world units) of the top left corner of the rendered shape.
widthThe maximum width (in world units) that can be occupied by the rendered shape.
heightThe maximum height (in world units) that can be occupied by the rendered shape.
Returns
The scale that was automatically calculated for the rendered shape to fit the specified size.

◆ Save() [1/2]

void Aspose::Words::Rendering::NodeRendererBase::Save ( System::SharedPtr< System::IO::Stream stream,
System::SharedPtr< Aspose::Words::Saving::ImageSaveOptions saveOptions 
)

Renders the shape into an image and saves into a stream.

Parameters
streamThe stream where to save the image of the shape.
saveOptionsSpecifies 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() [2/2]

void Aspose::Words::Rendering::NodeRendererBase::Save ( System::String  fileName,
System::SharedPtr< Aspose::Words::Saving::ImageSaveOptions saveOptions 
)

Renders the shape into an image and saves into a file.

Parameters
fileNameThe name for the image file. If a file with the specified name already exists, the existing file is overwritten.
saveOptionsSpecifies the options that control how the shape is rendered and saved. Can be null.