Represents properties such as color, width etc. of the lines and curves being drawn. Objects of this class should only be allocated using System::MakeObject() function. Never create instance of this type on stack or using operator new, as it will result in runtime errors and/or assertion faults. Always wrap this class into System::SmartPtr pointer and use this pointer to pass it to functions as argument. More...

Inherits System::Object.

Public Member Functions

ASPOSECPP_SHARED_API Pen (const Color &color)
 Constructs a new Pen object representing the specified color. More...
 
ASPOSECPP_SHARED_API Pen (const Color &color, float width)
 Constructs a new Pen object representing the specified color and width. More...
 
ASPOSECPP_SHARED_API Pen (const SharedPtr< Brush > &brush)
 Constructs a new Pen object and initializes it with the specified Brush object. More...
 
ASPOSECPP_SHARED_API Pen (const SharedPtr< Brush > &brush, float width)
 Constructs a new Pen object and initializes it with the specified Brush object. More...
 
ASPOSECPP_SHARED_API Drawing2D::PenAlignment get_Alignment () const
 Returns a value that indicates the alignment of the current Pen object. More...
 
ASPOSECPP_SHARED_API void set_Alignment (Drawing2D::PenAlignment value)
 Sets the alignment of the current Pen object. More...
 
ASPOSECPP_SHARED_API float get_Width () const
 Returns the width of the current Pen object. More...
 
ASPOSECPP_SHARED_API void set_Width (float value)
 Sets the width of the current Pen object. More...
 
ASPOSECPP_SHARED_API Drawing2D::LineCap get_StartCap () const
 Returns a value that indicates the starting line cap of the current Pen object. More...
 
ASPOSECPP_SHARED_API void set_StartCap (Drawing2D::LineCap value)
 Sets the starting line cap of the current Pen object. More...
 
ASPOSECPP_SHARED_API Drawing2D::LineCap get_EndCap () const
 Returns a value that indicates the ending line cap of the current Pen object. More...
 
ASPOSECPP_SHARED_API void set_EndCap (Drawing2D::LineCap value)
 Sets the ending line cap of the current Pen object. More...
 
ASPOSECPP_SHARED_API Drawing2D::LineJoin get_LineJoin () const
 Returns a value that indicates how the lines drawn by this Pen object are joined. More...
 
ASPOSECPP_SHARED_API void set_LineJoin (Drawing2D::LineJoin value)
 Sets a value that specifies how the lines drawn by this Pen object are joined. More...
 
ASPOSECPP_SHARED_API float get_MiterLimit () const
 Returns the limit of the thickness of the join on a mitered corner. More...
 
ASPOSECPP_SHARED_API void set_MiterLimit (float value)
 Sets the limit of the thickness of the join on a mitered corner. More...
 
ASPOSECPP_SHARED_API float get_DashOffset () const
 Returns the distance from the start of a line to the beginning of a dash pattern. More...
 
ASPOSECPP_SHARED_API void set_DashOffset (float value)
 Sets the distance from the start of a line to the beginning of a dash pattern. More...
 
ASPOSECPP_SHARED_API Drawing2D::DashCap get_DashCap () const
 Returns a value that indicates the cap used at the both ends of a dashed line. More...
 
ASPOSECPP_SHARED_API void set_DashCap (Drawing2D::DashCap value)
 Sets a value that specifies the cap used at the both ends of a dashed line. More...
 
ASPOSECPP_SHARED_API Drawing2D::DashStyle get_DashStyle () const
 Returns a value that indicates the dash style of the current Pen object. More...
 
ASPOSECPP_SHARED_API void set_DashStyle (Drawing2D::DashStyle value)
 Sets a value that specifies the dash style of the current Pen object. More...
 
ASPOSECPP_SHARED_API System::ArrayPtr< float > get_DashPattern () const
 Returns an array indicating custom dash pattern in a dashed line. More...
 
ASPOSECPP_SHARED_API void set_DashPattern (const System::ArrayPtr< float > &value)
 Sets an array specifying custom dash pattern in a dashed line. The array consists of numbers that specify the lengths of alternating dashes and spaces. More...
 
ASPOSECPP_SHARED_API System::ArrayPtr< float > get_CompoundArray () const
 Returns an array of values that specifies a compound pen. More...
 
ASPOSECPP_SHARED_API void set_CompoundArray (const System::ArrayPtr< float > &value)
 Sets an array of values that specifies a compound pen. More...
 
ASPOSECPP_SHARED_API SharedPtr< Drawing2D::Matrixget_Transform ()
 Returns a copy of a Matrix object that specifies the geometrical transformations for the pen represneted by the current object. More...
 
ASPOSECPP_SHARED_API void set_Transform (const SharedPtr< Drawing2D::Matrix > &value)
 Sets a Matrix object that specifies the geometrical transformations for the pen represneted by the current object. More...
 
ASPOSECPP_SHARED_API void set_CustomStartCap (const SharedPtr< Drawing2D::CustomLineCap > &value)
 Sets the custom start line cap. More...
 
ASPOSECPP_SHARED_API void set_CustomEndCap (const SharedPtr< Drawing2D::CustomLineCap > &value)
 Sets the custom end line cap. More...
 
ASPOSECPP_SHARED_API void set_Brush (const SharedPtr< Brush > &brush)
 Sets this pen's Brush object. More...
 
ASPOSECPP_SHARED_API SharedPtr< Brushget_Brush ()
 Returns this pen's Brush object. More...
 
ASPOSECPP_SHARED_API void set_Color (const Color &color)
 Sets this pen's color. More...
 
ASPOSECPP_SHARED_API Color get_Color () const
 Returns this pen's color. More...
 
ASPOSECPP_SHARED_API SharedPtr< PenClone ()
 Returns a copy of the current object. More...
 
ASPOSECPP_SHARED_API void ResetTransform ()
 Resets the current object's transform matrix so that it becomes an identity matrix. More...
 
ASPOSECPP_SHARED_API void MultiplyTransform (const SharedPtr< Drawing2D::Matrix > &matrix, Drawing2D::MatrixOrder order=Drawing2D::MatrixOrder::Prepend)
 Multiplies current object's transform matrix by the specified matrix. More...
 
ASPOSECPP_SHARED_API void RotateTransform (float angle, Drawing2D::MatrixOrder order=Drawing2D::MatrixOrder::Prepend)
 Rotates the local geometric transformation by the specified angle in the specified order. More...
 
ASPOSECPP_SHARED_API void ScaleTransform (float sx, float sy, Drawing2D::MatrixOrder order=Drawing2D::MatrixOrder::Prepend)
 Scales the local geometric transformation by the specified factors in the specified order. More...
 
ASPOSECPP_SHARED_API void TranslateTransform (float dx, float dy, Drawing2D::MatrixOrder order=Drawing2D::MatrixOrder::Prepend)
 Translates the local geometric transformation by the specified dimensions in the specified order. More...
 
ASPOSECPP_SHARED_API void SetLineCap (Drawing2D::LineCap startCap, Drawing2D::LineCap endCap, Drawing2D::DashCap dashCap)
 NOT IMPLEMENTED. More...
 
ASPOSECPP_SHARED_API Drawing2D::PenType get_PenType () const
 NOT IMPLEMENTED. More...
 
void Dispose ()
 Releases all operating resources acquired by the current object. More...
 
- Public Member Functions inherited from System::Object
ASPOSECPP_SHARED_API Object ()
 Creates object. Initializes all internal data structures. More...
 
virtual ASPOSECPP_SHARED_API ~Object ()
 Destroys object. Frees all internal data structures. More...
 
ASPOSECPP_SHARED_API Object (Object const &x)
 Copy constructor. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More...
 
Objectoperator= (Object const &x)
 Assignment operator. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More...
 
ObjectSharedRefAdded ()
 Increments shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
int SharedRefRemovedSafe ()
 Decrements and returns shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
int RemovedSharedRefs (int count)
 Decreases shared reference count by specified value. More...
 
Detail::SmartPtrCounter * WeakRefAdded ()
 Increments weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
void WeakRefRemoved ()
 Decrements weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
Detail::SmartPtrCounter * GetCounter ()
 Gets reference counter data structure associated with the object. More...
 
int SharedCount () const
 Gets current value of shared reference counter. More...
 
ASPOSECPP_SHARED_API void Lock ()
 Implements C# lock() statement locking. Call directly or use LockContext sentry object. More...
 
ASPOSECPP_SHARED_API void Unlock ()
 Implements C# lock() statement unlocking. Call directly or use LockContext sentry object. More...
 
virtual ASPOSECPP_SHARED_API bool Equals (ptr obj)
 Compares objects using C# Object.Equals semantics. More...
 
virtual ASPOSECPP_SHARED_API int32_t GetHashCode () const
 Analog of C# Object.GetHashCode() method. Enables hashing of custom objects. More...
 
virtual ASPOSECPP_SHARED_API String ToString () const
 Analog of C# Object.ToString() method. Enables converting custom objects to string. More...
 
virtual ASPOSECPP_SHARED_API ptr MemberwiseClone () const
 Analog of C# Object.MemberwiseClone() method. Enables cloning custom types. More...
 
virtual ASPOSECPP_SHARED_API const TypeInfoGetType () const
 Gets actual type of object. Analog of C# System.Object.GetType() call. More...
 
virtual ASPOSECPP_SHARED_API bool Is (const TypeInfo &targetType) const
 Check if object represents an instance of type described by targetType. Analog of C# 'is' operator. More...
 
virtual ASPOSECPP_SHARED_API void SetTemplateWeakPtr (uint32_t argument)
 Set n'th template argument a weak pointer (rather than shared). Allows switching pointers in containers to weak mode. More...
 
virtual ASPOSECPP_SHARED_API bool FastCast (const Details::FastRttiBase &helper, void **out_ptr) const
 For internal purposes only. More...
 
template<>
bool Equals (float const &objA, float const &objB)
 Emulates C#-style floating point comparison where two NaNs are considered equal even though according to IEC 60559:1989 NaN is not equal to any value, including NaN. More...
 
template<>
bool Equals (double const &objA, double const &objB)
 Emulates C#-style floating point comparison where two NaNs are considered equal even though according to IEC 60559:1989 NaN is not equal to any value, including NaN. More...
 
template<>
bool ReferenceEquals (String const &str, std::nullptr_t)
 Specialization of Object::ReferenceEquals for case of string and nullptr. More...
 
template<>
bool ReferenceEquals (String const &str1, String const &str2)
 Specialization of Object::ReferenceEquals for case of strings. More...
 

Protected Member Functions

virtual ASPOSECPP_SHARED_API void Apply (SkPaint &paint, const SharedPtr< Drawing2D::Matrix > &matrix, bool antialiased=false, bool is_closed_path=false)
 Sets the properties of the current pen on the specified SkPaint object. More...
 

Additional Inherited Members

- Public Types inherited from System::Object
typedef SmartPtr< Objectptr
 Alias for smart pointer type. More...
 
- Static Public Member Functions inherited from System::Object
static bool ReferenceEquals (ptr const &objA, ptr const &objB)
 Compares objects by reference. More...
 
template<typename T >
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, T const &objB)
 Compares objects by reference. More...
 
template<typename T >
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, std::nullptr_t)
 Reference-compares value type object with nullptr. More...
 
template<typename T1 , typename T2 >
static std::enable_if< IsSmartPtr< T1 >::value &&IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 Compares reference type objects in C# style. More...
 
template<typename T1 , typename T2 >
static std::enable_if<!IsSmartPtr< T1 >::value &&!IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 Compares value type objects in C# style. More...
 
static const TypeInfoType ()
 Implements C# typeof(System.Object) construct. More...
 

Detailed Description

Represents properties such as color, width etc. of the lines and curves being drawn. Objects of this class should only be allocated using System::MakeObject() function. Never create instance of this type on stack or using operator new, as it will result in runtime errors and/or assertion faults. Always wrap this class into System::SmartPtr pointer and use this pointer to pass it to functions as argument.

Constructor & Destructor Documentation

◆ Pen() [1/4]

ASPOSECPP_SHARED_API System::Drawing::Pen::Pen ( const Color color)

Constructs a new Pen object representing the specified color.

Parameters
colorThe color of the pen represented by the object being constructed

◆ Pen() [2/4]

ASPOSECPP_SHARED_API System::Drawing::Pen::Pen ( const Color color,
float  width 
)

Constructs a new Pen object representing the specified color and width.

Parameters
colorThe color of the pen represented by the object being constructed
widthThe width of the pen represented by the object being constructed

◆ Pen() [3/4]

ASPOSECPP_SHARED_API System::Drawing::Pen::Pen ( const SharedPtr< Brush > &  brush)

Constructs a new Pen object and initializes it with the specified Brush object.

Parameters
brushThe Brush object that specifies the fill properties of the pen represented by the object being constructed

◆ Pen() [4/4]

ASPOSECPP_SHARED_API System::Drawing::Pen::Pen ( const SharedPtr< Brush > &  brush,
float  width 
)

Constructs a new Pen object and initializes it with the specified Brush object.

Parameters
brushThe Brush object that specifies the fill properties of the pen represented by the object being constructed
widthThe width of the pen represented by the object being constructed

Member Function Documentation

◆ Apply()

virtual ASPOSECPP_SHARED_API void System::Drawing::Pen::Apply ( SkPaint &  paint,
const SharedPtr< Drawing2D::Matrix > &  matrix,
bool  antialiased = false,
bool  is_closed_path = false 
)
protectedvirtual

Sets the properties of the current pen on the specified SkPaint object.

Parameters
paintAn object set the properties on
matrixGraphics world transformation matrix
antialiasedSpecifies if 'antialiased' property should be set on the specified SkPaint object.
is_closed_pathThe flag specifies that the path is closed.

◆ Clone()

ASPOSECPP_SHARED_API SharedPtr<Pen> System::Drawing::Pen::Clone ( )

Returns a copy of the current object.

◆ Dispose()

void System::Drawing::Pen::Dispose ( )
inline

Releases all operating resources acquired by the current object.

◆ get_Alignment()

ASPOSECPP_SHARED_API Drawing2D::PenAlignment System::Drawing::Pen::get_Alignment ( ) const

Returns a value that indicates the alignment of the current Pen object.

◆ get_Brush()

ASPOSECPP_SHARED_API SharedPtr<Brush> System::Drawing::Pen::get_Brush ( )

Returns this pen's Brush object.

◆ get_Color()

ASPOSECPP_SHARED_API Color System::Drawing::Pen::get_Color ( ) const

Returns this pen's color.

◆ get_CompoundArray()

ASPOSECPP_SHARED_API System::ArrayPtr<float> System::Drawing::Pen::get_CompoundArray ( ) const

Returns an array of values that specifies a compound pen.

◆ get_DashCap()

ASPOSECPP_SHARED_API Drawing2D::DashCap System::Drawing::Pen::get_DashCap ( ) const

Returns a value that indicates the cap used at the both ends of a dashed line.

◆ get_DashOffset()

ASPOSECPP_SHARED_API float System::Drawing::Pen::get_DashOffset ( ) const

Returns the distance from the start of a line to the beginning of a dash pattern.

◆ get_DashPattern()

ASPOSECPP_SHARED_API System::ArrayPtr<float> System::Drawing::Pen::get_DashPattern ( ) const

Returns an array indicating custom dash pattern in a dashed line.

◆ get_DashStyle()

ASPOSECPP_SHARED_API Drawing2D::DashStyle System::Drawing::Pen::get_DashStyle ( ) const

Returns a value that indicates the dash style of the current Pen object.

◆ get_EndCap()

ASPOSECPP_SHARED_API Drawing2D::LineCap System::Drawing::Pen::get_EndCap ( ) const

Returns a value that indicates the ending line cap of the current Pen object.

◆ get_LineJoin()

ASPOSECPP_SHARED_API Drawing2D::LineJoin System::Drawing::Pen::get_LineJoin ( ) const

Returns a value that indicates how the lines drawn by this Pen object are joined.

◆ get_MiterLimit()

ASPOSECPP_SHARED_API float System::Drawing::Pen::get_MiterLimit ( ) const

Returns the limit of the thickness of the join on a mitered corner.

◆ get_PenType()

ASPOSECPP_SHARED_API Drawing2D::PenType System::Drawing::Pen::get_PenType ( ) const

NOT IMPLEMENTED.

Exceptions
NotImplementedExceptionAlways

◆ get_StartCap()

ASPOSECPP_SHARED_API Drawing2D::LineCap System::Drawing::Pen::get_StartCap ( ) const

Returns a value that indicates the starting line cap of the current Pen object.

◆ get_Transform()

ASPOSECPP_SHARED_API SharedPtr<Drawing2D::Matrix> System::Drawing::Pen::get_Transform ( )

Returns a copy of a Matrix object that specifies the geometrical transformations for the pen represneted by the current object.

◆ get_Width()

ASPOSECPP_SHARED_API float System::Drawing::Pen::get_Width ( ) const

Returns the width of the current Pen object.

◆ MultiplyTransform()

ASPOSECPP_SHARED_API void System::Drawing::Pen::MultiplyTransform ( const SharedPtr< Drawing2D::Matrix > &  matrix,
Drawing2D::MatrixOrder  order = Drawing2D::MatrixOrder::Prepend 
)

Multiplies current object's transform matrix by the specified matrix.

Parameters
matrixThe matrix by which the current object's transform matrix is multiplied
orderSpecifies the order of the operation

◆ ResetTransform()

ASPOSECPP_SHARED_API void System::Drawing::Pen::ResetTransform ( )

Resets the current object's transform matrix so that it becomes an identity matrix.

◆ RotateTransform()

ASPOSECPP_SHARED_API void System::Drawing::Pen::RotateTransform ( float  angle,
Drawing2D::MatrixOrder  order = Drawing2D::MatrixOrder::Prepend 
)

Rotates the local geometric transformation by the specified angle in the specified order.

Parameters
angleThe rotation angle
orderSpecifies the order of the operation

◆ ScaleTransform()

ASPOSECPP_SHARED_API void System::Drawing::Pen::ScaleTransform ( float  sx,
float  sy,
Drawing2D::MatrixOrder  order = Drawing2D::MatrixOrder::Prepend 
)

Scales the local geometric transformation by the specified factors in the specified order.

Parameters
sxScale factor by which to perform scaling in in X-axis direction
syScale factor by which to perform scaling in in Y-axis direction
orderSpecifies the order of the operation

◆ set_Alignment()

ASPOSECPP_SHARED_API void System::Drawing::Pen::set_Alignment ( Drawing2D::PenAlignment  value)

Sets the alignment of the current Pen object.

Parameters
valueThe value to set

◆ set_Brush()

ASPOSECPP_SHARED_API void System::Drawing::Pen::set_Brush ( const SharedPtr< Brush > &  brush)

Sets this pen's Brush object.

Parameters
brushThe value to set

◆ set_Color()

ASPOSECPP_SHARED_API void System::Drawing::Pen::set_Color ( const Color color)

Sets this pen's color.

Parameters
colorThe value to set

◆ set_CompoundArray()

ASPOSECPP_SHARED_API void System::Drawing::Pen::set_CompoundArray ( const System::ArrayPtr< float > &  value)

Sets an array of values that specifies a compound pen.

Parameters
valueThe value to set

◆ set_CustomEndCap()

ASPOSECPP_SHARED_API void System::Drawing::Pen::set_CustomEndCap ( const SharedPtr< Drawing2D::CustomLineCap > &  value)

Sets the custom end line cap.

Parameters
valueThe value to set

◆ set_CustomStartCap()

ASPOSECPP_SHARED_API void System::Drawing::Pen::set_CustomStartCap ( const SharedPtr< Drawing2D::CustomLineCap > &  value)

Sets the custom start line cap.

Parameters
valueThe value to set

◆ set_DashCap()

ASPOSECPP_SHARED_API void System::Drawing::Pen::set_DashCap ( Drawing2D::DashCap  value)

Sets a value that specifies the cap used at the both ends of a dashed line.

Parameters
valueThe value to set

◆ set_DashOffset()

ASPOSECPP_SHARED_API void System::Drawing::Pen::set_DashOffset ( float  value)

Sets the distance from the start of a line to the beginning of a dash pattern.

Parameters
valueThe value to set

◆ set_DashPattern()

ASPOSECPP_SHARED_API void System::Drawing::Pen::set_DashPattern ( const System::ArrayPtr< float > &  value)

Sets an array specifying custom dash pattern in a dashed line. The array consists of numbers that specify the lengths of alternating dashes and spaces.

◆ set_DashStyle()

ASPOSECPP_SHARED_API void System::Drawing::Pen::set_DashStyle ( Drawing2D::DashStyle  value)

Sets a value that specifies the dash style of the current Pen object.

Parameters
valueThe value to set

◆ set_EndCap()

ASPOSECPP_SHARED_API void System::Drawing::Pen::set_EndCap ( Drawing2D::LineCap  value)

Sets the ending line cap of the current Pen object.

Parameters
valueThe value to set

◆ set_LineJoin()

ASPOSECPP_SHARED_API void System::Drawing::Pen::set_LineJoin ( Drawing2D::LineJoin  value)

Sets a value that specifies how the lines drawn by this Pen object are joined.

Parameters
valueThe value to set

◆ set_MiterLimit()

ASPOSECPP_SHARED_API void System::Drawing::Pen::set_MiterLimit ( float  value)

Sets the limit of the thickness of the join on a mitered corner.

Parameters
valueThe value to set

◆ set_StartCap()

ASPOSECPP_SHARED_API void System::Drawing::Pen::set_StartCap ( Drawing2D::LineCap  value)

Sets the starting line cap of the current Pen object.

Parameters
valueThe value to set

◆ set_Transform()

ASPOSECPP_SHARED_API void System::Drawing::Pen::set_Transform ( const SharedPtr< Drawing2D::Matrix > &  value)

Sets a Matrix object that specifies the geometrical transformations for the pen represneted by the current object.

Parameters
valueThe value to set

◆ set_Width()

ASPOSECPP_SHARED_API void System::Drawing::Pen::set_Width ( float  value)

Sets the width of the current Pen object.

Parameters
valueThe value to set

◆ SetLineCap()

ASPOSECPP_SHARED_API void System::Drawing::Pen::SetLineCap ( Drawing2D::LineCap  startCap,
Drawing2D::LineCap  endCap,
Drawing2D::DashCap  dashCap 
)

NOT IMPLEMENTED.

Exceptions
NotImplementedExceptionAlways

◆ TranslateTransform()

ASPOSECPP_SHARED_API void System::Drawing::Pen::TranslateTransform ( float  dx,
float  dy,
Drawing2D::MatrixOrder  order = Drawing2D::MatrixOrder::Prepend 
)

Translates the local geometric transformation by the specified dimensions in the specified order.

Parameters
dxThe value of translation in x
dyThe value of translation in y
orderSpecifies the order of the operation