System::Drawing::TextureBrush Class Reference

Inherits System::Drawing::Brush.

Public Member Functions

 TextureBrush (const SharedPtr< Image > &image, Drawing2D::WrapMode wrap_mode=Drawing2D::WrapMode::Tile)
 
 TextureBrush (const SharedPtr< Image > &image, RectangleF dst_rect, const SharedPtr< Imaging::ImageAttributes > &image_attrs=nullptr)
 
 TextureBrush (const SharedPtr< Image > &image, Drawing2D::WrapMode wrap_mode, RectangleF dst_rect)
 
 TextureBrush (const SharedPtr< Image > &image, Drawing2D::WrapMode wrap_mode, Rectangle dst_rect)
 
virtual ~TextureBrush ()
 Destructor. More...
 
SharedPtr< Imageget_Image ()
 Returns an image used by the current TextureBrush object. More...
 
Drawing2D::WrapMode get_WrapMode ()
 Returns a value that specifies how the brush represented by the current object is tiled. More...
 
void set_WrapMode (Drawing2D::WrapMode wrap_mode)
 
System::SharedPtr< Drawing2D::Matrixget_Transform ()
 
void set_Transform (const System::SharedPtr< Drawing2D::Matrix > &matrix)
 
void ResetTransform ()
 Resets the current object's transform matrix so that it becomes an identity matrix. More...
 
void ScaleTransform (float sx, float sy, Drawing2D::MatrixOrder order=Drawing2D::MatrixOrder::Prepend)
 
void RotateTransform (float angle, Drawing2D::MatrixOrder order=Drawing2D::MatrixOrder::Prepend)
 
void TranslateTransform (float dx, float dy, Drawing2D::MatrixOrder order=Drawing2D::MatrixOrder::Prepend)
 
void MultiplyTransform (const SharedPtr< Drawing2D::Matrix > &matrix, Drawing2D::MatrixOrder order=Drawing2D::MatrixOrder::Prepend)
 
virtual SharedPtr< BrushClone () override
 
- Public Member Functions inherited from System::Drawing::Brush
void Dispose ()
 Releases operating system resources acquired by the current object. More...
 
- Public Member Functions inherited from System::Object
 Object ()
 Creates object. Initializes all internal data structures. More...
 
virtual ~Object ()
 Destroys object. Frees all internal data structures. More...
 
 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...
 
void SharedRefRemoved ()
 Decrements shared reference count and deletes object if it hits zero. Shouldn't be called directly; instead, use smart pointers or ThisProtector. 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 refernce counter. More...
 
void FreeOrDetectCycles (int count)
 Reacts on shared reference counter decrement. Shouldn't be called directly, use smart pointers instead. If neccessary, deletes the object. If allowed, initiates loop references lookup. More...
 
void Lock ()
 Implements C# lock() statement locking. Call directly or use LockContext sentry object. More...
 
void Unlock ()
 Implements C# lock() statement unlocking. Call directly or use LockContext sentry object. More...
 
virtual bool Equals (ptr obj)
 Compares objects using C# Object.Equals semantics. More...
 
virtual int GetHashCode () const
 Analog of C# Object.GetHashCode() method. Enables hashing of custom objects. More...
 
virtual String ToString () ASPOSE_CONST
 Analog of C# Object.ToString() method. Enables converting custom objects to string. More...
 
virtual ptr MemberwiseClone () const
 Analog of C# Object.MemberwiseClone() method. Enables cloning custom types. More...
 
virtual const TypeInfoGetType () const
 Gets actual type of object. Analog of C# System.Object.GetType() call. More...
 
virtual bool Is (const TypeInfo &targetType) const
 Check if object represents an instance of type described by targetType. Analog of C# 'is' operator. More...
 
void __FreePointers ()
 Resets all smart pointers stored inside this object directly (in fields) or indirectly (in value type fields). Used by memory management systems, shouldn't be called directly. More...
 
virtual void SetTemplateWeakPtr (unsigned int argument)
 Set n'th template argument a weak pointer (rather than shared). Allows switching pointers in containers to weak mode. More...
 
template<>
bool Equals (float const &objA, float const &objB)
 
template<>
bool Equals (double const &objA, double const &objB)
 
template<>
bool ReferenceEquals (String const &str, std::nullptr_t)
 
template<>
bool ReferenceEquals (String const &str1, String const &str2)
 

Protected Member Functions

virtual void Apply (SkPaint &paint, float scale_x, float scale_y, bool apply_shift) override
 
void InitBrushSettings (const SharedPtr< Image > &image, Drawing2D::WrapMode wrap_mode, Rectangle dst_rect)
 
- Protected Member Functions inherited from System::Object
template<class Container , typename Value = typename Container::value_type>
std::enable_if<!System::IsSmartPtr< Value >::value &&!System::detail::is_a< Value, std::pair >::value, void >::type PopulateSharedMembers (Object::shared_members_type &, const char *, Container &)
 
template<class Container , typename Value = typename Container::value_type>
std::enable_if< System::IsSmartPtr< Value >::value, void >::type PopulateSharedMembers (Object::shared_members_type &data, const char *name, Container &container)
 
template<class Container , typename Value = typename Container::value_type>
std::enable_if< System::detail::is_a< Value, std::pair >::value &&!System::IsSmartPtr< typename Value::first_type >::value &&!System::IsSmartPtr< typename Value::second_type >::value, void >::type PopulateSharedMembers (Object::shared_members_type &, const char *, Container &)
 
template<class Container , typename Value = typename Container::value_type>
std::enable_if< System::detail::is_a< Value, std::pair >::value &&System::IsSmartPtr< typename Value::first_type >::value &&!System::IsSmartPtr< typename Value::second_type >::value, void >::type PopulateSharedMembers (Object::shared_members_type &data, const char *name, Container &container)
 
template<class Container , typename Value = typename Container::value_type>
std::enable_if< System::detail::is_a< Value, std::pair >::value &&!System::IsSmartPtr< typename Value::first_type >::value &&System::IsSmartPtr< typename Value::second_type >::value, void >::type PopulateSharedMembers (Object::shared_members_type &data, const char *name, Container &container)
 
template<class Container , typename Value = typename Container::value_type>
std::enable_if< System::detail::is_a< Value, std::pair >::value &&System::IsSmartPtr< typename Value::first_type >::value &&System::IsSmartPtr< typename Value::second_type >::value, void >::type PopulateSharedMembers (Object::shared_members_type &data, const char *name, Container &container)
 

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 ()
 Impleemnts C# typeof(System.Object) construct. More...
 
- Protected Types inherited from System::Object
template<class T >
using supports_free_pointers = decltype(__SupportsFreePointers(std::declval< T * >()))
 Checks if T type supports __FreePointers() method. More...
 
- Static Protected Member Functions inherited from System::Object
template<class T , class Check = decltype(std::declval<T*>()->__FreePointers())>
static std::true_type __SupportsFreePointers (T *)
 Formal function for template magic to check if type T supports __FreePointers() method. More...
 
static std::false_type __SupportsFreePointers (...)
 Formal function for template magic to check if type T supports __FreePointers() method. More...
 
template<class T >
static std::enable_if< supports_free_pointers< T >::value, void >::type __DoFreePointers (T &t)
 
template<class T >
static std::enable_if<!supports_free_pointers< T >::value &&!std::is_fundamental< T >::value &&!std::is_enum< T >::value &&!std::is_const< T >::value, void >::type __DoFreePointers (const T &)
 
template<class T >
static std::enable_if<!supports_free_pointers< T >::value &&!std::is_fundamental< T >::value &&!std::is_enum< T >::value &&std::is_const< T >::value, void >::type __DoFreePointers (T &)
 
template<class T >
static std::enable_if< std::is_fundamental< T >::value||std::is_enum< T >::value, void >::type __DoFreePointers (T)
 

Detailed Description

Represents a brush that uses an image to fill the interior of a shape. 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

◆ TextureBrush() [1/4]

System::Drawing::TextureBrush::TextureBrush ( const SharedPtr< Image > &  image,
Drawing2D::WrapMode  wrap_mode = Drawing2D::WrapMode::Tile 
)

Constructs a new instance of TextureBrush class that uses the specified image.

Parameters
imageAn image used by the brush to fill the interior of a shape
wrap_modeSpecifies how the brush object is tiled

◆ TextureBrush() [2/4]

System::Drawing::TextureBrush::TextureBrush ( const SharedPtr< Image > &  image,
RectangleF  dst_rect,
const SharedPtr< Imaging::ImageAttributes > &  image_attrs = nullptr 
)

Constructs a new instance of TextureBrush class that uses the specified image.

Parameters
imageAn image used by the brush to fill the interior of a shape
dst_rectSpecifies the bounding rectangle for the brush
image_attrsThe image attributes

◆ TextureBrush() [3/4]

System::Drawing::TextureBrush::TextureBrush ( const SharedPtr< Image > &  image,
Drawing2D::WrapMode  wrap_mode,
RectangleF  dst_rect 
)

Constructs a new instance of TextureBrush class that uses the specified image.

Parameters
imageAn image used by the brush to fill the interior of a shape
wrap_modeSpecifies how the brush object is tiled
dst_rectSpecifies the bounding rectangle for the brush

◆ TextureBrush() [4/4]

System::Drawing::TextureBrush::TextureBrush ( const SharedPtr< Image > &  image,
Drawing2D::WrapMode  wrap_mode,
Rectangle  dst_rect 
)

Constructs a new instance of TextureBrush class that uses the specified image.

Parameters
imageAn image used by the brush to fill the interior of a shape
wrap_modeSpecifies how the brush object is tiled
dst_rectSpecifies the bounding rectangle for the brush

◆ ~TextureBrush()

virtual System::Drawing::TextureBrush::~TextureBrush ( )
virtual

Destructor.

Member Function Documentation

◆ Apply()

virtual void System::Drawing::TextureBrush::Apply ( SkPaint &  paint,
float  scale_x,
float  scale_y,
bool  apply_shift 
)
overrideprotectedvirtual

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

Parameters
paintAn object set the properties on
scale_xIs used to make brush's texture micro adjustments
scale_yIs used to make brush's texture micro adjustments
apply_shiftIs used to make a small brush's texture position shift

Implements System::Drawing::Brush.

◆ Clone()

virtual SharedPtr<Brush> System::Drawing::TextureBrush::Clone ( )
overridevirtual

Creates a copy of the current object.

Returns
A shared pointer to the copy of the current object.

Implements System::Drawing::Brush.

◆ get_Image()

SharedPtr<Image> System::Drawing::TextureBrush::get_Image ( )

Returns an image used by the current TextureBrush object.

◆ get_Transform()

System::SharedPtr<Drawing2D::Matrix> System::Drawing::TextureBrush::get_Transform ( )

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

◆ get_WrapMode()

Drawing2D::WrapMode System::Drawing::TextureBrush::get_WrapMode ( )

Returns a value that specifies how the brush represented by the current object is tiled.

◆ InitBrushSettings()

void System::Drawing::TextureBrush::InitBrushSettings ( const SharedPtr< Image > &  image,
Drawing2D::WrapMode  wrap_mode,
Rectangle  dst_rect 
)
protected

Initializes a newly created TextureBrush object.

Parameters
imageAn image used by the brush to fill the interior of a shape
wrap_modeSpecifies how the brush object is tiled
dst_rectSpecifies the bounding rectangle for the brush

◆ MultiplyTransform()

void System::Drawing::TextureBrush::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()

void System::Drawing::TextureBrush::ResetTransform ( )

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

◆ RotateTransform()

void System::Drawing::TextureBrush::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()

void System::Drawing::TextureBrush::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_Transform()

void System::Drawing::TextureBrush::set_Transform ( const System::SharedPtr< Drawing2D::Matrix > &  matrix)

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

Parameters
matrixThe value to set

◆ set_WrapMode()

void System::Drawing::TextureBrush::set_WrapMode ( Drawing2D::WrapMode  wrap_mode)

Sets a value that specifies how the brush represented by the current object is tiled.

Parameters
wrap_modeThe value to set

◆ TranslateTransform()

void System::Drawing::TextureBrush::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