9 #ifndef __WXGDIPLUSDRAWER_H__
10 #define __WXGDIPLUSDRAWER_H__
17 #include "a2dprivate.h"
19 #if wxART2D_USE_GDIPLUSDRAWER
26 #include "wx/geometry.h"
30 using namespace Gdiplus;
34 WX_DECLARE_LIST( Region, RegionList );
39 a2dGDIPlusDrawer(
int width = 100,
int height = 100 );
40 a2dGDIPlusDrawer(
const wxSize& size );
42 a2dGDIPlusDrawer(
const a2dGDIPlusDrawer& other );
44 virtual ~a2dGDIPlusDrawer( );
51 wxBitmap GetBuffer()
const {
return m_buffer; }
54 void SetBufferSize(
int w,
int h );
57 wxBitmap GetSubBitmap( wxRect sub_rect )
const;
59 void CopyIntoBuffer(
const wxBitmap& bitm );
62 virtual void PushTransform();
63 virtual void PushIdentityTransform();
65 virtual void PopTransform(
void );
68 virtual void BeginDraw();
71 virtual void EndDraw();
79 void SetRenderDC( wxDC* dc );
81 wxDC* GetDeviceDC()
const {
return m_deviceDC; }
83 void BlitBuffer( wxRect rect,
const wxPoint& bufferpos = wxPoint( 0, 0 ) );
86 virtual void BlitBuffer( wxDC* dc, wxRect rect,
const wxPoint& bufferpos = wxPoint( 0, 0 ) );
88 void ShiftBuffer(
int dxy,
bool yshift );
92 void SetClippingRegion(
a2dVertexList* points,
bool spline =
false, wxPolygonFillMode fillStyle = wxODDEVEN_RULE );
98 void PopClippingRegion( );
100 void SetClippingRegionDev( wxCoord minx, wxCoord miny, wxCoord width, wxCoord height );
102 void SetClippingRegion(
double minx,
double miny,
double maxx,
double maxy );
104 void DestroyClippingRegion( );
106 virtual void DrawRoundedRectangle(
double x,
double y,
double width,
double height,
double radius,
bool pixelsize =
false );
108 virtual void DrawCircle(
double x,
double y,
double radius );
111 void DrawPoint(
double xc,
double yc );
113 virtual void DrawEllipse(
double x,
double y,
double width,
double height );
115 void DrawImage(
const wxImage& image,
double x,
double y,
double width,
double height, wxUint8 Opacity = 255 );
117 void DrawImage(
const a2dImageRGBA& image,
double x,
double y,
double width,
double height, wxUint8 Opacity = 255 );
119 void SetTextBackgroundMode(
int mode );
125 void DoSetActiveStroke();
127 void DoSetActiveFill();
129 virtual void DeviceDrawPolygon(
unsigned int n,
bool spline , wxPolygonFillMode fillStyle );
131 virtual void DeviceDrawLines(
unsigned int n,
bool spline );
133 void DeviceDrawLine(
double x1,
double y1,
double x2,
double y2 );
135 void DeviceDrawHorizontalLine(
int x1,
int y1,
int x2,
bool use_stroke_color );
137 void DeviceDrawVerticalLine(
int x1,
int y1,
int y2,
bool use_stroke_color );
139 void DeviceDrawPixel(
int x1,
int y1,
unsigned char r,
unsigned char g,
unsigned char b,
unsigned char a = 255 );
141 virtual void DrawTextDc(
const wxString& text,
double x,
double y );
144 virtual void DrawCharStroke( wxChar c );
146 virtual void DrawCharFreetype( wxChar c );
148 virtual void DrawCharDc( wxChar c );
150 Matrix* _get_gdiplus_user_to_device_transform();
152 GdiplusStartupInput m_gdiplus_startup_input;
153 ULONG_PTR m_gdiplus_token;
160 RegionList m_clipping_region_stack;
163 Brush* m_current_brush;
168 GraphicsPath* m_brushPath;
172 wxClientDC* m_deviceDC;
182 GraphicsPath* createGraphicsPath(
a2dVertexList* list,
bool spline =
false, wxPolygonFillMode fillStyle = wxODDEVEN_RULE );
186 #endif // wxART2D_USE_GDIPLUS_DRAWER
188 #endif // __WXGDIPLUSDRAWER_H__
Stroke and fill base classes.
vertex list of line and arc segments.
a2dDrawStyle
Define the manner in which a2dCanvasView draws to the device.
Drawing context abstraction.
A 2x3 affine matrix class for 2D transformations.
Contains graphical drawing context specific classes. a2dDrawer2D and derived classes are used for dra...
a2dBooleanClip
Used for defining how a ClippingRegion defined as a polygon is combined with.