wxgraphicscontexta wxgraphicscontext instance is the object that is drawn upon. it is created by a renderer using the createcontext calls.., this can be either directly using a renderer instance, or indirectly using the static convenience createxxx functions of wxgraphicscontext that always delegate the task to the default renderer. derived from include files <wx/graphics.h> members
wxgraphicscontext::create
wxgraphicscontext::createwxgraphicscontext* create(const wxwindowdc& dc) creates a wxgraphicscontext from a wxwindowdc (eg a wxpaintdc). wxgraphicscontext* create(wxwindow* window) creates a wxgraphicscontext from a wxwindow. see also wxgraphicsrenderer:: createcontext
wxgraphicscontext::createfromnativecreates a wxgraphicscontext from a native context. this native context must be eg a cgcontextref for core graphics, a graphics pointer for gdiplus or a cairo_t pointer for cairo. wxgraphicscontext* createfromnative(void * context) creates a wxgraphicscontext from a native window. see also wxgraphicsrenderer:: createcontextfromnativecontext
wxgraphicscontext::createfromnativewindowwxgraphicscontext* createfromnativewindow(void * window) see also wxgraphicsrenderer:: createcontextfromnativewindow
wxgraphicscontext::createpenwxgraphicspen createpen(const wxpen& pen) const creates a native pen from a wxpen.
wxgraphicscontext::createbrushwxgraphicsbrush createbrush(const wxbrush& brush) const creates a native brush from a wxbrush.
wxgraphicscontext::createradialgradientbrushwxgraphicsbrush createradialgradientbrush(wxdouble xo, wxdouble yo, wxdouble xc, wxdouble yc, wxdouble radius, const wxcolour& ocolor, const wxcolour& ccolor) const creates a native brush, having a radial gradient originating at (xo,yc) with color ocolour and ends on a circle around (xc,yc) with radius r and color ccolour
wxgraphicscontext::createlineargradientbrushwxgraphicsbrush createlineargradientbrush(wxdouble x1, wxdouble y1, wxdouble x2, wxdouble y2, const wxcolour&c1, const wxcolour&c2) const creates a native brush, having a linear gradient, starting at (x1,y1) with color c1 to (x2,y2) with color c2
wxgraphicscontext::createfontwxgraphicsfont createfont(const wxfont& font, const wxcolour& col = *wxblack) const creates a native graphics font from a wxfont and a text colour.
wxgraphicscontext::creatematrixwxgraphicsmatrix 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 creates a native affine transformation matrix from the passed in values. the defaults result in an identity matrix.
wxgraphicscontext::createpathwxgraphicspath createpath() const creates a native graphics path which is initially empty.
wxgraphicscontext::clipvoid clip(const wxregion& region) clips drawings to the region, combined to current clipping region void clip(wxdouble x, wxdouble y, wxdouble w, wxdouble h) clips drawings to the rectangle.
wxgraphicscontext::resetclipvoid resetclip() resets the clipping to original shape.
wxgraphicscontext::drawbitmapvoid drawbitmap(const wxbitmap& bmp, wxdouble x, wxdouble y, wxdouble w, wxdouble h) draws the bitmap. in case of a mono bitmap, this is treated as a mask and the current brushed is used for filling.
wxgraphicscontext::drawellipsevoid drawellipse(wxdouble x, wxdouble y, wxdouble w, wxdouble h) draws an ellipse.
wxgraphicscontext::drawiconvoid drawicon(const wxicon& icon, wxdouble x, wxdouble y, wxdouble w, wxdouble h) draws the icon.
wxgraphicscontext::drawlinesvoid drawlines(size_t n, const wxpoint2ddouble* points, int fillstyle = wxoddeven_rule) draws a polygon.
wxgraphicscontext::drawpathvoid drawpath(const wxgraphicspath& path, int fillstyle = wxoddeven_rule) draws the path by first filling and then stroking.
wxgraphicscontext::drawrectanglevoid drawrectangle(wxdouble x, wxdouble y, wxdouble w, wxdouble h) draws a rectangle.
wxgraphicscontext::drawroundedrectanglevoid drawroundedrectangle(wxdouble x, wxdouble y, wxdouble w, wxdouble h, wxdouble radius) draws a rounded rectangle.
wxgraphicscontext::drawtextvoid drawtext(const wxstring& str, wxdouble x, wxdouble y, wxdouble angle) void drawtext(const wxstring& str, wxdouble x, wxdouble y) draws a text at the defined position, at the given angle.
wxgraphicscontext::fillpathvoid fillpath(const wxgraphicspath& path, int fillstyle = wxoddeven_rule) fills the path with the current brush.
wxgraphicscontext::strokepathvoid strokepath(const wxgraphicspath& path) strokes along a path with the current pen.
wxgraphicscontext::getnativecontextvoid * getnativecontext() returns the native context (cgcontextref for core graphics, graphics pointer for gdiplus and cairo_t pointer for cairo).
wxgraphicscontext::getpartialtextextentsvoid getpartialtextextents(const wxstring& text, wxarraydouble& widths) const fills the widths array with the widths from the beginning of text to the corresponding character of text.
wxgraphicscontext::gettextextentvoid gettextextent(const wxstring& text, wxdouble* width, wxdouble* height, wxdouble* descent, wxdouble* externalleading) const gets the dimensions of the string using the currently selected font. string is the text string to measure, w and h are the total width and height respectively, descent is the dimension from the baseline of the font to the bottom of the descender, and externalleading is any extra vertical space added to the font by the font designer (usually is zero).
wxgraphicscontext::rotatevoid rotate(wxdouble angle) rotates the current transformation matrix (radians),
wxgraphicscontext::scalevoid scale(wxdouble xscale, wxdouble yscale) scales the current transformation matrix.
wxgraphicscontext::translatevoid translate(wxdouble dx, wxdouble dy) translates the current transformation matrix.
wxgraphicscontext::gettransformwxgraphicsmatrix gettransform() const gets the current transformation matrix of this context.
wxgraphicscontext::settransformvoid settransform(const wxgraphicsmatrix& matrix) sets the current transformation matrix of this context
wxgraphicscontext::concattransformvoid concattransform(const wxgraphicsmatrix& matrix) concatenates the passed in transform with the current transform of this context
wxgraphicscontext::setbrushvoid setbrush(const wxbrush& brush) void setbrush(const wxgraphicsbrush& brush) sets the brush for filling paths.
wxgraphicscontext::setfontvoid setfont(const wxfont& font, const wxcolour& colour) void setfont(const wxgraphicsfont& font) sets the font for drawing text.
wxgraphicscontext::setpenvoid setpen(const wxgraphicspen& pen) void setpen(const wxpen& pen) sets the pen used for stroking.
wxgraphicscontext::strokelinevoid strokeline(wxdouble x1, wxdouble y1, wxdouble x2, wxdouble y2) strokes a single line.
wxgraphicscontext::strokelinesvoid strokelines(size_t n, const wxpoint2ddouble* beginpoints, const wxpoint2ddouble* endpoints) void strokelines(size_t n, const wxpoint2ddouble* points) stroke disconnected lines from begin to end points, fastest method available for this purpose.
|