CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
texture_brush.h
1
2#ifndef _aspose_drawing_texture_brush_h
3#define _aspose_drawing_texture_brush_h
4
5#include "fwd.h"
6#include "brush.h"
7#include "image.h"
8#include "drawing2d/wrap_mode.h"
9#include "drawing2d/matrix.h"
10#include "drawing2d/matrix_order.h"
11#include "rectangle.h"
12#include "rectangle_f.h"
13#include "imaging/image_attributes.h"
14#include "drawing2d/wrap_mode.h"
15
16#include <memory>
17
18#ifdef ASPOSECPPLIB_BEING_BUILT
19#include "core/SkShader.h"
20#endif
21
23ASPOSECPP_3RD_PARTY_CLASS(SkBitmap);
25ASPOSECPP_3RD_PARTY_CLASS(SkMatrix);
27ASPOSECPP_3RD_PARTY_CLASS(SkPaint);
29ASPOSECPP_3RD_PARTY_CLASS(SkShader);
30
31
32namespace System { namespace Drawing {
37class ASPOSECPP_SHARED_CLASS TextureBrush : public Brush
38{
40 RTTI_INFO(System::Drawing::TextureBrush, ::System::BaseTypesInfo<System::Drawing::Brush>);
41
42public:
43 friend class Graphics;
44
48 ASPOSECPP_SHARED_API TextureBrush(const SharedPtr<Image>& image, Drawing2D::WrapMode wrap_mode = Drawing2D::WrapMode::Tile);
53 ASPOSECPP_SHARED_API TextureBrush(const SharedPtr<Image>& image, RectangleF dst_rect, const SharedPtr<Imaging::ImageAttributes>& image_attrs = nullptr);
58 ASPOSECPP_SHARED_API TextureBrush(const SharedPtr<Image>& image, Rectangle dst_rect, const SharedPtr<Imaging::ImageAttributes>& image_attrs = nullptr);
63 ASPOSECPP_SHARED_API TextureBrush(const SharedPtr<Image>& image, Drawing2D::WrapMode wrap_mode, RectangleF dst_rect);
68 ASPOSECPP_SHARED_API TextureBrush(const SharedPtr<Image>& image, Drawing2D::WrapMode wrap_mode, Rectangle dst_rect);
70 virtual ASPOSECPP_SHARED_API ~TextureBrush();
71
73 ASPOSECPP_SHARED_API SharedPtr<Image> get_Image();
75 ASPOSECPP_SHARED_API Drawing2D::WrapMode get_WrapMode();
78 ASPOSECPP_SHARED_API void set_WrapMode(Drawing2D::WrapMode wrap_mode);
79
86 ASPOSECPP_SHARED_API void set_Transform(const System::SharedPtr<Drawing2D::Matrix>& matrix);
87
89 ASPOSECPP_SHARED_API void ResetTransform();
94 ASPOSECPP_SHARED_API void ScaleTransform(float sx, float sy, Drawing2D::MatrixOrder order = Drawing2D::MatrixOrder::Prepend);
98 ASPOSECPP_SHARED_API void RotateTransform(float angle, Drawing2D::MatrixOrder order = Drawing2D::MatrixOrder::Prepend);
103 ASPOSECPP_SHARED_API void TranslateTransform(float dx, float dy, Drawing2D::MatrixOrder order = Drawing2D::MatrixOrder::Prepend);
108
111 virtual ASPOSECPP_SHARED_API SharedPtr<Brush> Clone() override;
112
113protected:
118 virtual ASPOSECPP_SHARED_API void Apply(SkPaint &paint, const SharedPtr<Drawing2D::Matrix>& matrix, bool apply_shift) override;
119
124 ASPOSECPP_SHARED_API void InitBrushSettings(const SharedPtr<Image>& image, Drawing2D::WrapMode wrap_mode, Rectangle dst_rect);
125
129 SharedPtr<Drawing2D::Matrix> m_transform_matrix = System::MakeObject<Drawing2D::Matrix>();
132
136 std::unique_ptr<SkBitmap> m_brush_bitmap;
137
138private:
140 TextureBrush(const TextureBrush& brush);
141 MEMBER_FUNCTION_MAKE_OBJECT(TextureBrush, CODEPORTING_ARGS(const TextureBrush& brush), CODEPORTING_ARGS(brush));
142};
143
144}} // namespace System { namespace Drawing {
145
146#endif // #ifndef texture_brush_h
A base class for classes that represent fillers used to fill the interiors of graphical shapes....
Definition: brush.h:18
Represents a drawing surface. Objects of this class should only be allocated using System::MakeObject...
Definition: graphics.h:68
Represents a rectangular area of an image defined as single-precision floating point X and Y coordina...
Definition: rectangle_f.h:15
Represents a rectangular area of an image defined as integer X and Y coordinates of its upper left co...
Definition: rectangle.h:19
Represents a brush that uses an image to fill the interior of a shape. Objects of this class should o...
Definition: texture_brush.h:38
void InitBrushSettings(const SharedPtr< Image > &image, Drawing2D::WrapMode wrap_mode, Rectangle dst_rect)
Initializes a newly created TextureBrush object.
void set_WrapMode(Drawing2D::WrapMode wrap_mode)
Sets a value that specifies how the brush represented by the current object is tiled.
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.
TextureBrush(const SharedPtr< Image > &image, Drawing2D::WrapMode wrap_mode, Rectangle dst_rect)
Constructs a new instance of TextureBrush class that uses the specified image.
void MultiplyTransform(const SharedPtr< Drawing2D::Matrix > &matrix, Drawing2D::MatrixOrder order=Drawing2D::MatrixOrder::Prepend)
Multiplies current object's transform matrix by the specified matrix.
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.
TextureBrush(const SharedPtr< Image > &image, Drawing2D::WrapMode wrap_mode, RectangleF dst_rect)
Constructs a new instance of TextureBrush class that uses the specified image.
System::SharedPtr< Drawing2D::Matrix > get_Transform()
Returns a copy of a Matrix object that specifies the geometrical transformations for the brush repres...
SharedPtr< Image > get_Image()
Returns an image used by the current TextureBrush object.
TextureBrush(const SharedPtr< Image > &image, Drawing2D::WrapMode wrap_mode=Drawing2D::WrapMode::Tile)
Constructs a new instance of TextureBrush class that uses the specified image.
virtual void Apply(SkPaint &paint, const SharedPtr< Drawing2D::Matrix > &matrix, bool apply_shift) override
Sets the properties of the current brush on the specified SkPaint object.
void ResetTransform()
Resets the current object's transform matrix so that it becomes an identity matrix.
virtual SharedPtr< Brush > Clone() override
Creates a copy of the current object.
void set_Transform(const System::SharedPtr< Drawing2D::Matrix > &matrix)
Sets a Matrix object that specifies the geometrical transformations for the brush represneted by the ...
Rectangle m_texture_rect
The bounding rectangle of this TextureBrush object.
Definition: texture_brush.h:131
Drawing2D::WrapMode get_WrapMode()
Returns a value that specifies how the brush represented by the current object is tiled.
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.
SharedPtr< Image > m_image
An image used by the current object.
Definition: texture_brush.h:127
std::unique_ptr< SkBitmap > m_brush_bitmap
Brush bitmap.
Definition: texture_brush.h:136
void RotateTransform(float angle, Drawing2D::MatrixOrder order=Drawing2D::MatrixOrder::Prepend)
Rotates the local geometric transformation by the specified angle in the specified order.
virtual ~TextureBrush()
Destructor.
TextureBrush(const SharedPtr< Image > &image, Rectangle dst_rect, const SharedPtr< Imaging::ImageAttributes > &image_attrs=nullptr)
Constructs a new instance of TextureBrush class that uses the specified image.
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
MatrixOrder
Specifies the order of matrix transform operations.
Definition: matrix_order.h:7
@ Prepend
The new operation is applied before the old operation.
WrapMode
Specifies how a texture or a gradient is tiled when it is smaller than the area being filled.
Definition: wrap_mode.h:9
@ Tile
Tiles the gradient or texture.
Definition: db_command.h:9