.. include:: headings.inc .. _GraphicsContext: ========================================================================================================================================== |phoenix_title| **GraphicsContext** ========================================================================================================================================== A :ref:`GraphicsContext` instance is the object that is drawn upon. It is created by a renderer using :meth:`GraphicsRenderer.CreateContext` . This can be either directly using a renderer instance, or indirectly using the static convenience :meth:`~GraphicsContext.Create` functions of :ref:`GraphicsContext` that always delegate the task to the default renderer. :: def OnPaint(self, event): # Create paint DC dc = wx.PaintDC(self) # Create graphics context from it gc = wx.GraphicsContext.Create(dc) if gc: # make a path that contains a circle and some lines gc.SetPen(wx.RED_PEN) path = gc.CreatePath() path.AddCircle(50.0, 50.0, 50.0) path.MoveToPoint(0.0, 50.0) path.AddLineToPoint(100.0, 50.0) path.MoveToPoint(50.0, 0.0) path.AddLineToPoint(50.0, 100.0) path.CloseSubpath() path.AddRectangle(25.0, 25.0, 50.0, 50.0) gc.StrokePath(path) .. seealso:: :meth:`GraphicsRenderer.CreateContext` , :ref:`GCDC`, :ref:`DC` | |class_hierarchy| Inheritance Diagram ===================================== Inheritance diagram for class **GraphicsContext** .. raw:: html

Inheritance diagram of GraphicsContext

| |method_summary| Methods Summary ================================ ================================================================================ ================================================================================ :meth:`~GraphicsContext.BeginLayer` Redirects all rendering is done into a fully transparent temporary context. :meth:`~GraphicsContext.Clip` Clips drawings to the specified region. :meth:`~GraphicsContext.ConcatTransform` Concatenates the passed in transform with the current transform of this context. :meth:`~GraphicsContext.Create` Creates a :ref:`GraphicsContext` from a :ref:`Window`. :meth:`~GraphicsContext.CreateBitmap` Creates :ref:`GraphicsBitmap` from an existing :ref:`Bitmap`. :meth:`~GraphicsContext.CreateBitmapFromImage` Creates :ref:`GraphicsBitmap` from an existing :ref:`Image`. :meth:`~GraphicsContext.CreateBrush` Creates a native brush from a :ref:`Brush`. :meth:`~GraphicsContext.CreateFont` Creates a native graphics font from a :ref:`Font` and a text colour. :meth:`~GraphicsContext.CreateFromNative` Creates a :ref:`GraphicsContext` from a native context. :meth:`~GraphicsContext.CreateFromNativeWindow` Creates a :ref:`GraphicsContext` from a native window. :meth:`~GraphicsContext.CreateLinearGradientBrush` Creates a native brush with a linear gradient. :meth:`~GraphicsContext.CreateMatrix` Creates a native affine transformation matrix from the passed in values. :meth:`~GraphicsContext.CreatePath` Creates a native graphics path which is initially empty. :meth:`~GraphicsContext.CreatePen` Creates a native pen from a :ref:`Pen`. :meth:`~GraphicsContext.CreateRadialGradientBrush` Creates a native brush with a radial gradient. :meth:`~GraphicsContext.CreateSubBitmap` Extracts a sub-bitmap from an existing bitmap. :meth:`~GraphicsContext.DisableOffset` :meth:`~GraphicsContext.DrawBitmap` Draws the bitmap. :meth:`~GraphicsContext.DrawEllipse` Draws an ellipse. :meth:`~GraphicsContext.DrawIcon` Draws the icon. :meth:`~GraphicsContext.DrawPath` Draws the path by first filling and then stroking. :meth:`~GraphicsContext.DrawRectangle` Draws a rectangle. :meth:`~GraphicsContext.DrawRoundedRectangle` Draws a rounded rectangle. :meth:`~GraphicsContext.DrawText` Draws text at the defined position. :meth:`~GraphicsContext.EnableOffset` :meth:`~GraphicsContext.EndLayer` Composites back the drawings into the context with the opacity given at the BeginLayer call. :meth:`~GraphicsContext.FillPath` Fills the path with the current brush. :meth:`~GraphicsContext.GetAntialiasMode` Returns the current shape antialiasing mode. :meth:`~GraphicsContext.GetCompositionMode` Returns the current compositing operator. :meth:`~GraphicsContext.GetInterpolationQuality` Returns the current interpolation quality. :meth:`~GraphicsContext.GetNativeContext` Returns the native context (CGContextRef for Core Graphics, Graphics pointer for GDIPlus and cairo_t pointer for cairo). :meth:`~GraphicsContext.GetPartialTextExtents` Fills the `widths` array with the widths from the beginning of `text` to the corresponding character of `text`. :meth:`~GraphicsContext.GetFullTextExtent` Gets the dimensions of the string using the currently selected font. :meth:`~GraphicsContext.GetTransform` Gets the current transformation matrix of this context. :meth:`~GraphicsContext.OffsetEnabled` :meth:`~GraphicsContext.PopState` Pops a stored state from the stack and sets the current transformation matrix to that state. :meth:`~GraphicsContext.PushState` Push the current state of the context's transformation matrix on a stack. :meth:`~GraphicsContext.ResetClip` Resets the clipping to original shape. :meth:`~GraphicsContext.Rotate` Rotates the current transformation matrix (in radians). :meth:`~GraphicsContext.Scale` Scales the current transformation matrix. :meth:`~GraphicsContext.SetAntialiasMode` Sets the antialiasing mode, returns ``True`` if it supported. :meth:`~GraphicsContext.SetBrush` Sets the brush for filling paths. :meth:`~GraphicsContext.SetCompositionMode` Sets the compositing operator, returns ``True`` if it supported. :meth:`~GraphicsContext.SetFont` Sets the font for drawing text. :meth:`~GraphicsContext.SetInterpolationQuality` Sets the interpolation quality, returns ``True`` if it is supported. :meth:`~GraphicsContext.SetPen` Sets the pen used for stroking. :meth:`~GraphicsContext.SetTransform` Sets the current transformation matrix of this context. :meth:`~GraphicsContext.StrokeLine` Strokes a single line. :meth:`~GraphicsContext.StrokeLineSegments` Stroke disconnected lines from begin to end points. :meth:`~GraphicsContext.StrokePath` Strokes along a path with the current pen. :meth:`~GraphicsContext.Translate` Translates the current transformation matrix. ================================================================================ ================================================================================ | |property_summary| Properties Summary ===================================== ================================================================================ ================================================================================ :attr:`~GraphicsContext.AntialiasMode` See :meth:`~GraphicsContext.GetAntialiasMode` and :meth:`~GraphicsContext.SetAntialiasMode` :attr:`~GraphicsContext.CompositionMode` See :meth:`~GraphicsContext.GetCompositionMode` and :meth:`~GraphicsContext.SetCompositionMode` :attr:`~GraphicsContext.InterpolationQuality` See :meth:`~GraphicsContext.GetInterpolationQuality` and :meth:`~GraphicsContext.SetInterpolationQuality` :attr:`~GraphicsContext.NativeContext` See :meth:`~GraphicsContext.GetNativeContext` :attr:`~GraphicsContext.TextExtent` See :meth:`~GraphicsContext.GetTextExtent` :attr:`~GraphicsContext.Transform` See :meth:`~GraphicsContext.GetTransform` and :meth:`~GraphicsContext.SetTransform` ================================================================================ ================================================================================ | |api| Class API =============== .. class:: GraphicsContext(GraphicsObject) A GraphicsContext instance is the object that is drawn upon. .. method:: BeginLayer(self, opacity) Redirects all rendering is done into a fully transparent temporary context. :param `opacity`: :type `opacity`: float .. method:: Clip(self, *args, **kw) |overload| **Overloaded Implementations**: **~~~** **Clip** `(self, region)` Clips drawings to the specified region. :param `region`: :type `region`: Region **~~~** **Clip** `(self, x, y, w, h)` Clips drawings to the specified rectangle. :param `x`: :type `x`: float :param `y`: :type `y`: float :param `w`: :type `w`: float :param `h`: :type `h`: float **~~~** .. method:: ConcatTransform(self, matrix) Concatenates the passed in transform with the current transform of this context. :param `matrix`: :type `matrix`: GraphicsMatrix .. staticmethod:: Create(*args, **kw) |overload| **Overloaded Implementations**: **~~~** **Create** `(window)` Creates a :ref:`GraphicsContext` from a :ref:`Window`. :param `window`: :type `window`: Window :rtype: :ref:`GraphicsContext` .. seealso:: :meth:`GraphicsRenderer.CreateContext` **~~~** **Create** `(windowDC)` Creates a :ref:`GraphicsContext` from a :ref:`WindowDC`. :param `windowDC`: :type `windowDC`: WindowDC :rtype: :ref:`GraphicsContext` .. seealso:: :meth:`GraphicsRenderer.CreateContext` **~~~** **Create** `(memoryDC)` Creates a :ref:`GraphicsContext` from a :ref:`MemoryDC`. :param `memoryDC`: :type `memoryDC`: MemoryDC :rtype: :ref:`GraphicsContext` .. seealso:: :meth:`GraphicsRenderer.CreateContext` **~~~** **Create** `(printerDC)` Creates a :ref:`GraphicsContext` from a :ref:`PrinterDC`. Under GTK+, this will only work when using the GtkPrint printing backend which is available since GTK+ 2.10. :param `printerDC`: :type `printerDC`: PrinterDC :rtype: :ref:`GraphicsContext` .. seealso:: :meth:`GraphicsRenderer.CreateContext` , **~~~** **Create** `(image)` Creates a :ref:`GraphicsContext` associated with a :ref:`Image`. The image specifies the size of the context as well as whether alpha is supported (if :meth:`Image.HasAlpha` ) or not and the initial contents of the context. The `image` object must have a life time greater than that of the new context as the context copies its contents back to the image when it is destroyed. :param `image`: :type `image`: Image :rtype: :ref:`GraphicsContext` .. versionadded:: 2.9.3 **~~~** .. method:: CreateBitmap(self, bitmap) Creates :ref:`GraphicsBitmap` from an existing :ref:`Bitmap`. Returns an invalid NullGraphicsBitmap on failure. :param `bitmap`: :type `bitmap`: Bitmap :rtype: :ref:`GraphicsBitmap` .. method:: CreateBitmapFromImage(self, image) Creates :ref:`GraphicsBitmap` from an existing :ref:`Image`. This method is more efficient than converting :ref:`Image` to :ref:`Bitmap` first and then calling :meth:`CreateBitmap` but otherwise has the same effect. Returns an invalid NullGraphicsBitmap on failure. :param `image`: :type `image`: Image :rtype: :ref:`GraphicsBitmap` .. versionadded:: 2.9.3 .. method:: CreateBrush(self, brush) Creates a native brush from a :ref:`Brush`. :param `brush`: :type `brush`: Brush :rtype: :ref:`GraphicsBrush` .. method:: CreateFont(self, *args, **kw) |overload| **Overloaded Implementations**: **~~~** **CreateFont** `(self, font, col=BLACK)` Creates a native graphics font from a :ref:`Font` and a text colour. :param `font`: :type `font`: Font :param `col`: :type `col`: Colour :rtype: :ref:`GraphicsFont` **~~~** **CreateFont** `(self, sizeInPixels, facename, flags=FONTFLAG_DEFAULT, col=BLACK)` Creates a font object with the specified attributes. The use of overload taking :ref:`Font` is preferred, see :meth:`GraphicsRenderer.CreateFont` for more details. :param `sizeInPixels`: :type `sizeInPixels`: float :param `facename`: :type `facename`: string :param `flags`: :type `flags`: int :param `col`: :type `col`: Colour :rtype: :ref:`GraphicsFont` .. versionadded:: 2.9.3 **~~~** .. staticmethod:: CreateFromNative(context) Creates a :ref:`GraphicsContext` from a native context. This native context must be a CGContextRef for Core Graphics, a Graphics pointer for GDIPlus, or a cairo_t pointer for cairo. :param `context`: :rtype: :ref:`GraphicsContext` .. seealso:: :meth:`GraphicsRenderer.CreateContextFromNativeContext` .. staticmethod:: CreateFromNativeWindow(window) Creates a :ref:`GraphicsContext` from a native window. :param `window`: :rtype: :ref:`GraphicsContext` .. seealso:: :meth:`GraphicsRenderer.CreateContextFromNativeWindow` .. method:: CreateLinearGradientBrush(self, *args, **kw) Creates a native brush with a linear gradient. The brush starts at (`x1`, `y1`) and ends at (`x2`, `y2`). Either just the start and end gradient colours (`c1` and `c2`) or full set of gradient `stops` can be specified. The version taking :ref:`GraphicsGradientStops` is new in wxWidgets 2.9.1. |overload| **Overloaded Implementations**: **~~~** **CreateLinearGradientBrush** `(self, x1, y1, x2, y2, c1, c2)` :param `x1`: :type `x1`: float :param `y1`: :type `y1`: float :param `x2`: :type `x2`: float :param `y2`: :type `y2`: float :param `c1`: :type `c1`: Colour :param `c2`: :type `c2`: Colour :rtype: :ref:`GraphicsBrush` **~~~** **CreateLinearGradientBrush** `(self, x1, y1, x2, y2, stops)` :param `x1`: :type `x1`: float :param `y1`: :type `y1`: float :param `x2`: :type `x2`: float :param `y2`: :type `y2`: float :param `stops`: :type `stops`: GraphicsGradientStops :rtype: :ref:`GraphicsBrush` **~~~** .. method:: CreateMatrix(self, *args, **kw) |overload| **Overloaded Implementations**: **~~~** **CreateMatrix** `(self, a=1.0, b=0.0, c=0.0, d=1.0, tx=0.0, ty=0.0)` Creates a native affine transformation matrix from the passed in values. The default parameters result in an identity matrix. :param `a`: :type `a`: float :param `b`: :type `b`: float :param `c`: :type `c`: float :param `d`: :type `d`: float :param `tx`: :type `tx`: float :param `ty`: :type `ty`: float :rtype: :ref:`GraphicsMatrix` **~~~** **CreateMatrix** `(self, mat)` Creates a native affine transformation matrix from the passed generic one. :param `mat`: :type `mat`: AffineMatrix2DBase :rtype: :ref:`GraphicsMatrix` .. versionadded:: 2.9.4 **~~~** .. method:: CreatePath(self) Creates a native graphics path which is initially empty. :rtype: :ref:`GraphicsPath` .. method:: CreatePen(self, pen) Creates a native pen from a :ref:`Pen`. :param `pen`: :type `pen`: Pen :rtype: :ref:`GraphicsPen` .. method:: CreateRadialGradientBrush(self, *args, **kw) Creates a native brush with a radial gradient. The brush originates at (`xo`, `yc`) and ends on a circle around (`xc`, `yc`) with the given `radius`. The gradient may be specified either by its start and end colours `oColor` and `cColor` or by a full set of gradient `stops`. The version taking :ref:`GraphicsGradientStops` is new in wxWidgets 2.9.1. |overload| **Overloaded Implementations**: **~~~** **CreateRadialGradientBrush** `(self, xo, yo, xc, yc, radius, oColor, cColor)` :param `xo`: :type `xo`: float :param `yo`: :type `yo`: float :param `xc`: :type `xc`: float :param `yc`: :type `yc`: float :param `radius`: :type `radius`: float :param `oColor`: :type `oColor`: Colour :param `cColor`: :type `cColor`: Colour :rtype: :ref:`GraphicsBrush` **~~~** **CreateRadialGradientBrush** `(self, xo, yo, xc, yc, radius, stops)` :param `xo`: :type `xo`: float :param `yo`: :type `yo`: float :param `xc`: :type `xc`: float :param `yc`: :type `yc`: float :param `radius`: :type `radius`: float :param `stops`: :type `stops`: GraphicsGradientStops :rtype: :ref:`GraphicsBrush` **~~~** .. method:: CreateSubBitmap(self, bitmap, x, y, w, h) Extracts a sub-bitmap from an existing bitmap. Currently this function is implemented in the native MSW and OS X versions but not when using Cairo. :param `bitmap`: :type `bitmap`: GraphicsBitmap :param `x`: :type `x`: float :param `y`: :type `y`: float :param `w`: :type `w`: float :param `h`: :type `h`: float :rtype: :ref:`GraphicsBitmap` .. method:: DisableOffset(self) .. method:: DrawBitmap(self, *args, **kw) Draws the bitmap. In case of a mono bitmap, this is treated as a mask and the current brushed is used for filling. |overload| **Overloaded Implementations**: **~~~** **DrawBitmap** `(self, bmp, x, y, w, h)` :param `bmp`: :type `bmp`: GraphicsBitmap :param `x`: :type `x`: float :param `y`: :type `y`: float :param `w`: :type `w`: float :param `h`: :type `h`: float **~~~** **DrawBitmap** `(self, bmp, x, y, w, h)` :param `bmp`: :type `bmp`: Bitmap :param `x`: :type `x`: float :param `y`: :type `y`: float :param `w`: :type `w`: float :param `h`: :type `h`: float **~~~** .. method:: DrawEllipse(self, x, y, w, h) Draws an ellipse. :param `x`: :type `x`: float :param `y`: :type `y`: float :param `w`: :type `w`: float :param `h`: :type `h`: float .. method:: DrawIcon(self, icon, x, y, w, h) Draws the icon. :param `icon`: :type `icon`: Icon :param `x`: :type `x`: float :param `y`: :type `y`: float :param `w`: :type `w`: float :param `h`: :type `h`: float .. method:: DrawPath(self, path, fillStyle=ODDEVEN_RULE) Draws the path by first filling and then stroking. :param `path`: :type `path`: GraphicsPath :param `fillStyle`: :type `fillStyle`: PolygonFillMode .. method:: DrawRectangle(self, x, y, w, h) Draws a rectangle. :param `x`: :type `x`: float :param `y`: :type `y`: float :param `w`: :type `w`: float :param `h`: :type `h`: float .. method:: DrawRoundedRectangle(self, x, y, w, h, radius) Draws a rounded rectangle. :param `x`: :type `x`: float :param `y`: :type `y`: float :param `w`: :type `w`: float :param `h`: :type `h`: float :param `radius`: :type `radius`: float .. method:: DrawText(self, *args, **kw) |overload| **Overloaded Implementations**: **~~~** **DrawText** `(self, str, x, y)` Draws text at the defined position. :param `str`: :type `str`: string :param `x`: :type `x`: float :param `y`: :type `y`: float **~~~** **DrawText** `(self, str, x, y, angle)` Draws text at the defined position. :param `str`: The text to draw. :type `str`: string :param `x`: The x coordinate position to draw the text at. :type `x`: float :param `y`: The y coordinate position to draw the text at. :type `y`: float :param `angle`: The angle relative to the (default) horizontal direction to draw the string. :type `angle`: float **~~~** **DrawText** `(self, str, x, y, backgroundBrush)` Draws text at the defined position. :param `str`: The text to draw. :type `str`: string :param `x`: The x coordinate position to draw the text at. :type `x`: float :param `y`: The y coordinate position to draw the text at. :type `y`: float :param `backgroundBrush`: Brush to fill the text with. :type `backgroundBrush`: GraphicsBrush **~~~** **DrawText** `(self, str, x, y, angle, backgroundBrush)` Draws text at the defined position. :param `str`: The text to draw. :type `str`: string :param `x`: The x coordinate position to draw the text at. :type `x`: float :param `y`: The y coordinate position to draw the text at. :type `y`: float :param `angle`: The angle relative to the (default) horizontal direction to draw the string. :type `angle`: float :param `backgroundBrush`: Brush to fill the text with. :type `backgroundBrush`: GraphicsBrush **~~~** .. method:: EnableOffset(self, enable=True) :param `enable`: :type `enable`: bool .. method:: EndLayer(self) Composites back the drawings into the context with the opacity given at the BeginLayer call. .. method:: FillPath(self, path, fillStyle=ODDEVEN_RULE) Fills the path with the current brush. :param `path`: :type `path`: GraphicsPath :param `fillStyle`: :type `fillStyle`: PolygonFillMode .. method:: GetAntialiasMode(self) Returns the current shape antialiasing mode. :rtype: :ref:`AntialiasMode` .. method:: GetCompositionMode(self) Returns the current compositing operator. :rtype: :ref:`CompositionMode` .. method:: GetInterpolationQuality(self) Returns the current interpolation quality. :rtype: :ref:`InterpolationQuality` .. method:: GetNativeContext(self) Returns the native context (CGContextRef for Core Graphics, Graphics pointer for GDIPlus and cairo_t pointer for cairo). .. method:: GetPartialTextExtents(self, text) Fills the `widths` array with the widths from the beginning of `text` to the corresponding character of `text`. :param `text`: :type `text`: string :rtype: `list of floats` .. method:: GetFullTextExtent(self, *args, **kw) |overload| **Overloaded Implementations**: **~~~** **GetFullTextExtent** `(self, text)` Gets the dimensions of the string using the currently selected font. :param `text`: The text string to measure. :type `text`: string Variable to store the total calculated width of the text. Variable to store the total calculated height of the text. Variable to store the dimension from the baseline of the font to the bottom of the descender. Any extra vertical space added to the font by the font designer (usually is zero). :rtype: `tuple` :returns: ( `width`, `height`, `descent`, `externalLeading` ) **~~~** **GetFullTextExtent** `(self, text)` Gets the dimensions of the string using the currently selected font. :rtype: `tuple` :returns: ( `width`, `height` ) **~~~** .. method:: GetTransform(self) Gets the current transformation matrix of this context. :rtype: :ref:`GraphicsMatrix` .. method:: OffsetEnabled(self) :rtype: `bool` .. method:: PopState(self) Pops a stored state from the stack and sets the current transformation matrix to that state. .. seealso:: :meth:`GraphicsContext.PopState` .. method:: PushState(self) Push the current state of the context's transformation matrix on a stack. .. seealso:: :meth:`GraphicsContext.PopState` .. method:: ResetClip(self) Resets the clipping to original shape. .. method:: Rotate(self, angle) Rotates the current transformation matrix (in radians). :param `angle`: :type `angle`: float .. method:: Scale(self, xScale, yScale) Scales the current transformation matrix. :param `xScale`: :type `xScale`: float :param `yScale`: :type `yScale`: float .. method:: SetAntialiasMode(self, antialias) Sets the antialiasing mode, returns ``True`` if it supported. :param `antialias`: :type `antialias`: AntialiasMode :rtype: `bool` .. method:: SetBrush(self, *args, **kw) Sets the brush for filling paths. |overload| **Overloaded Implementations**: **~~~** **SetBrush** `(self, brush)` :param `brush`: :type `brush`: Brush **~~~** **SetBrush** `(self, brush)` :param `brush`: :type `brush`: GraphicsBrush **~~~** .. method:: SetCompositionMode(self, op) Sets the compositing operator, returns ``True`` if it supported. :param `op`: :type `op`: CompositionMode :rtype: `bool` .. method:: SetFont(self, *args, **kw) Sets the font for drawing text. |overload| **Overloaded Implementations**: **~~~** **SetFont** `(self, font, colour)` :param `font`: :type `font`: Font :param `colour`: :type `colour`: Colour **~~~** **SetFont** `(self, font)` :param `font`: :type `font`: GraphicsFont **~~~** .. method:: SetInterpolationQuality(self, interpolation) Sets the interpolation quality, returns ``True`` if it is supported. Not implemented in Cairo backend currently. :param `interpolation`: :type `interpolation`: InterpolationQuality :rtype: `bool` .. method:: SetPen(self, *args, **kw) Sets the pen used for stroking. |overload| **Overloaded Implementations**: **~~~** **SetPen** `(self, pen)` :param `pen`: :type `pen`: Pen **~~~** **SetPen** `(self, pen)` :param `pen`: :type `pen`: GraphicsPen **~~~** .. method:: SetTransform(self, matrix) Sets the current transformation matrix of this context. :param `matrix`: :type `matrix`: GraphicsMatrix .. method:: StrokeLine(self, x1, y1, x2, y2) Strokes a single line. :param `x1`: :type `x1`: float :param `y1`: :type `y1`: float :param `x2`: :type `x2`: float :param `y2`: :type `y2`: float .. method:: StrokeLineSegments(self, beginPoint2Ds, endPoint2Ds) Stroke disconnected lines from begin to end points. .. method:: StrokePath(self, path) Strokes along a path with the current pen. :param `path`: :type `path`: GraphicsPath .. method:: Translate(self, dx, dy) Translates the current transformation matrix. :param `dx`: :type `dx`: float :param `dy`: :type `dy`: float .. attribute:: AntialiasMode See :meth:`~GraphicsContext.GetAntialiasMode` and :meth:`~GraphicsContext.SetAntialiasMode` .. attribute:: CompositionMode See :meth:`~GraphicsContext.GetCompositionMode` and :meth:`~GraphicsContext.SetCompositionMode` .. attribute:: InterpolationQuality See :meth:`~GraphicsContext.GetInterpolationQuality` and :meth:`~GraphicsContext.SetInterpolationQuality` .. attribute:: NativeContext See :meth:`~GraphicsContext.GetNativeContext` .. attribute:: TextExtent See :meth:`~GraphicsContext.GetTextExtent` .. attribute:: Transform See :meth:`~GraphicsContext.GetTransform` and :meth:`~GraphicsContext.SetTransform`