+ static wxGraphicsContext* Create( wxWindow* window );
+
+#if wxUSE_IMAGE
+ // Create a context for drawing onto a wxImage. The image life time must be
+ // greater than that of the context itself as when the context is destroyed
+ // it will copy its contents to the specified image.
+ static wxGraphicsContext* Create(wxImage& image);
+#endif // wxUSE_IMAGE
+
+ // create a context that can be used for measuring texts only, no drawing allowed
+ static wxGraphicsContext * Create();
+
+ // begin a new document (relevant only for printing / pdf etc) if there is a progress dialog, message will be shown
+ virtual bool StartDoc( const wxString& message );
+
+ // done with that document (relevant only for printing / pdf etc)
+ virtual void EndDoc();
+
+ // opens a new page (relevant only for printing / pdf etc) with the given size in points
+ // (if both are null the default page size will be used)
+ virtual void StartPage( wxDouble width = 0, wxDouble height = 0 );
+
+ // ends the current page (relevant only for printing / pdf etc)
+ virtual void EndPage();
+
+ // make sure that the current content of this context is immediately visible
+ virtual void Flush();
+
+ wxGraphicsPath CreatePath() const;
+
+ virtual wxGraphicsPen CreatePen(const wxPen& pen) const;
+
+ virtual wxGraphicsBrush CreateBrush(const wxBrush& brush ) const;
+
+ // sets the brush to a linear gradient, starting at (x1,y1) and ending at
+ // (x2,y2) with the given boundary colours or the specified stops
+ wxGraphicsBrush
+ CreateLinearGradientBrush(wxDouble x1, wxDouble y1,
+ wxDouble x2, wxDouble y2,
+ const wxColour& c1, const wxColour& c2) const;
+ wxGraphicsBrush
+ CreateLinearGradientBrush(wxDouble x1, wxDouble y1,
+ wxDouble x2, wxDouble y2,
+ const wxGraphicsGradientStops& stops) const;
+
+ // sets the brush to a radial gradient originating at (xo,yc) and ending
+ // on a circle around (xc,yc) with the given radius; the colours may be
+ // specified by just the two extremes or the full array of gradient stops
+ wxGraphicsBrush
+ CreateRadialGradientBrush(wxDouble xo, wxDouble yo,
+ wxDouble xc, wxDouble yc, wxDouble radius,
+ const wxColour& oColor, const wxColour& cColor) const;
+
+ wxGraphicsBrush
+ CreateRadialGradientBrush(wxDouble xo, wxDouble yo,
+ wxDouble xc, wxDouble yc, wxDouble radius,
+ const wxGraphicsGradientStops& stops) const;
+
+ // creates a font
+ virtual wxGraphicsFont CreateFont( const wxFont &font , const wxColour &col = *wxBLACK ) const;
+ virtual wxGraphicsFont CreateFont(double sizeInPixels,
+ const wxString& facename,
+ int flags = wxFONTFLAG_DEFAULT,
+ const wxColour& col = *wxBLACK) const;
+
+ // create a native bitmap representation
+ virtual wxGraphicsBitmap CreateBitmap( const wxBitmap &bitmap ) const;
+#if wxUSE_IMAGE
+ wxGraphicsBitmap CreateBitmapFromImage(const wxImage& image) const;
+#endif // wxUSE_IMAGE
+
+ // create a native bitmap representation
+ virtual wxGraphicsBitmap CreateSubBitmap( const wxGraphicsBitmap &bitmap, wxDouble x, wxDouble y, wxDouble w, wxDouble h ) const;
+
+ // create a 'native' matrix corresponding to these values
+ virtual wxGraphicsMatrix CreateMatrix( wxDouble a=1.0, wxDouble b=0.0, wxDouble c=0.0, wxDouble d=1.0,
+ wxDouble tx=0.0, wxDouble ty=0.0) const;
+
+ wxGraphicsMatrix CreateMatrix( const wxAffineMatrix2DBase& mat ) const
+ {
+ wxMatrix2D mat2D;
+ wxPoint2DDouble tr;
+ mat.Get(&mat2D, &tr);
+
+ return CreateMatrix(mat2D.m_11, mat2D.m_12, mat2D.m_21, mat2D.m_22,
+ tr.m_x, tr.m_y);
+ }