.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2020 by Total Control Software
   License:   wxWindows License

.. include:: headings.inc



.. _wx.GraphicsPenInfo:

==========================================================================================================================================
|phoenix_title|  **wx.GraphicsPenInfo**
==========================================================================================================================================

This class is a helper used for :ref:`wx.GraphicsPen`  creation using the named parameter idiom: it allows specifying various :ref:`wx.GraphicsPen`  attributes using the chained calls to its clearly named methods instead of passing them in the fixed order to :ref:`wx.GraphicsPen`  constructors. 
         

Typically, you would use :ref:`wx.GraphicsPenInfo`  with a :ref:`wx.GraphicsContext`. For example, to start drawing with a dotted blue pen slightly wider than normal you could, write the following: ::

    ctx = wx.GraphicsContext.Create(dc)
    pen = ctx.CreatePen(wx.GraphicsPenInfo(wx.BLUE).Width(1.25).Style(wx.PENSTYLE_DOT))
    ctx.SetPen(pen)




         



.. versionadded:: 4.1/wxWidgets-3.1.1  
     







|

|class_hierarchy| Class Hierarchy
=================================

.. raw:: html

   <div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
   <img id="toggleBlock-trigger" src="_static/images/closed.png"/>
   Inheritance diagram for class <strong>GraphicsPenInfo</strong>:
   </div>
   <div id="toggleBlock-summary" style="display:block;"></div>
   <div id="toggleBlock-content" style="display:none;">
   <p class="graphviz">
   <center><img src="_static/images/inheritance/wx.GraphicsPenInfo_inheritance.svg" alt="Inheritance diagram of GraphicsPenInfo" usemap="#dummy" class="inheritance"/></center>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.GraphicsPenInfo.html" title="This class is a helper used for wx.GraphicsPen  creation using the named parameter idiom: it allows specifying various wx.GraphicsPen  attributes using the chained calls to its clearly named methods instead of passing them in the fixed order to wx.GraphicsPen  constructors." alt="" coords="5,5,177,34"/> </map> 
   </p>
   </div>

|


|method_summary| Methods Summary
================================

================================================================================ ================================================================================
:meth:`~wx.GraphicsPenInfo.__init__`                                             Constructor, which can set the colour, width and style for the pen.
:meth:`~wx.GraphicsPenInfo.Cap`                                                  Sets the cap (i.e., the end point) for the pen.
:meth:`~wx.GraphicsPenInfo.Colour`                                               Sets the colour for the pen.
:meth:`~wx.GraphicsPenInfo.GetCap`                                               Returns the pen's cap (i.e., end-point style).
:meth:`~wx.GraphicsPenInfo.GetColour`                                            Returns the pen's colour.
:meth:`~wx.GraphicsPenInfo.GetEndX`                                              Returns the x coordinate of the ending point (if using a gradient).
:meth:`~wx.GraphicsPenInfo.GetEndY`                                              Returns the y coordinate of the ending point (if using a gradient).
:meth:`~wx.GraphicsPenInfo.GetGradientType`                                      Returns the pen's gradient type.
:meth:`~wx.GraphicsPenInfo.GetJoin`                                              Returns the pen's joining method.
:meth:`~wx.GraphicsPenInfo.GetRadius`                                            Returns the radius of the radial gradient.
:meth:`~wx.GraphicsPenInfo.GetStartX`                                            Returns the x coordinate of the starting point (if using a gradient).
:meth:`~wx.GraphicsPenInfo.GetStartY`                                            Returns the y coordinate of the starting point (if using a gradient).
:meth:`~wx.GraphicsPenInfo.GetStipple`                                           Returns the pen's stipple bitmap.
:meth:`~wx.GraphicsPenInfo.GetStops`                                             Returns the stops of the gradient.
:meth:`~wx.GraphicsPenInfo.GetStyle`                                             Returns the pen's style.
:meth:`~wx.GraphicsPenInfo.GetWidth`                                             Returns the pen's line width.
:meth:`~wx.GraphicsPenInfo.GetX1`                                                Returns the x coordinate of the starting point (if using a gradient).
:meth:`~wx.GraphicsPenInfo.GetX2`                                                Returns the x coordinate of the ending point (if using a gradient).
:meth:`~wx.GraphicsPenInfo.GetY1`                                                Returns the y coordinate of the starting point (if using a gradient).
:meth:`~wx.GraphicsPenInfo.GetY2`                                                Returns the y coordinate of the ending point (if using a gradient).
:meth:`~wx.GraphicsPenInfo.IsTransparent`                                        Returns whether the pen is transparent.
:meth:`~wx.GraphicsPenInfo.Join`                                                 Sets the join for the pen, which is the appearance of where two lines meet or overlap.
:meth:`~wx.GraphicsPenInfo.LinearGradient`                                       Applies a linear gradient to the pen.
:meth:`~wx.GraphicsPenInfo.RadialGradient`                                       Applies a radial (i.e., circular) gradient to the pen.
:meth:`~wx.GraphicsPenInfo.Stipple`                                              Sets the bitmap used for stippling.
:meth:`~wx.GraphicsPenInfo.Style`                                                Sets the style for the pen.
:meth:`~wx.GraphicsPenInfo.Width`                                                Sets the line width for the pen.
================================================================================ ================================================================================


|


|property_summary| Properties Summary
=====================================

================================================================================ ================================================================================
:attr:`~wx.GraphicsPenInfo.EndX`                                                 See :meth:`~wx.GraphicsPenInfo.GetEndX`
:attr:`~wx.GraphicsPenInfo.EndY`                                                 See :meth:`~wx.GraphicsPenInfo.GetEndY`
:attr:`~wx.GraphicsPenInfo.GradientType`                                         See :meth:`~wx.GraphicsPenInfo.GetGradientType`
:attr:`~wx.GraphicsPenInfo.Radius`                                               See :meth:`~wx.GraphicsPenInfo.GetRadius`
:attr:`~wx.GraphicsPenInfo.StartX`                                               See :meth:`~wx.GraphicsPenInfo.GetStartX`
:attr:`~wx.GraphicsPenInfo.StartY`                                               See :meth:`~wx.GraphicsPenInfo.GetStartY`
:attr:`~wx.GraphicsPenInfo.Stops`                                                See :meth:`~wx.GraphicsPenInfo.GetStops`
:attr:`~wx.GraphicsPenInfo.X1`                                                   See :meth:`~wx.GraphicsPenInfo.GetX1`
:attr:`~wx.GraphicsPenInfo.X2`                                                   See :meth:`~wx.GraphicsPenInfo.GetX2`
:attr:`~wx.GraphicsPenInfo.Y1`                                                   See :meth:`~wx.GraphicsPenInfo.GetY1`
:attr:`~wx.GraphicsPenInfo.Y2`                                                   See :meth:`~wx.GraphicsPenInfo.GetY2`
================================================================================ ================================================================================


|


|api| Class API
===============


.. class:: wx.GraphicsPenInfo(object)

   **Possible constructors**::

       GraphicsPenInfo(colour=Colour(), width=1.0, style=PENSTYLE_SOLID) ->
                       None
       
   
   This class is a helper used for GraphicsPen creation using the named
   parameter idiom: it allows specifying various GraphicsPen attributes
   using the chained calls to its clearly named methods instead of
   passing them in the fixed order to GraphicsPen constructors.



   .. method:: __init__(self, colour=Colour(), width=1.0, style=PENSTYLE_SOLID)

      Constructor, which can set the colour, width and style for the pen. 
                 


      :param `colour`: 
      :type `colour`: wx.Colour
      :param `width`: 
      :type `width`: wx.Double
      :param `style`: 
      :type `style`: wx.PenStyle




      :rtype: `None`     








   .. method:: Cap(self, cap)

      Sets the cap (i.e., the end point) for the pen. 
                 


      :param `cap`: 
      :type `cap`: wx.PenCap




      :rtype: :ref:`wx.GraphicsPenInfo`








   .. method:: Colour(self, col)

      Sets the colour for the pen. 
                 


      :param `col`: 
      :type `col`: wx.Colour




      :rtype: :ref:`wx.GraphicsPenInfo`








   .. method:: GetCap(self)

      Returns the pen's cap (i.e., end-point style). 
                 

      :rtype: :ref:`wx.PenCap`








   .. method:: GetColour(self)

      Returns the pen's colour. 
                 

      :rtype: :ref:`wx.Colour`








   .. method:: GetEndX(self)

      Returns the x coordinate of the ending point (if using a gradient). 
                 

      :rtype: `float`








   .. method:: GetEndY(self)

      Returns the y coordinate of the ending point (if using a gradient). 
                 

      :rtype: `float`








   .. method:: GetGradientType(self)

      Returns the pen's gradient type. 
                 

      :rtype: :ref:`wx.GradientType`








   .. method:: GetJoin(self)

      Returns the pen's joining method. 
                 

      :rtype: :ref:`wx.PenJoin`








   .. method:: GetRadius(self)

      Returns the radius of the radial gradient. 
                 

      :rtype: `float`








   .. method:: GetStartX(self)

      Returns the x coordinate of the starting point (if using a gradient). 
                 

      :rtype: `float`








   .. method:: GetStartY(self)

      Returns the y coordinate of the starting point (if using a gradient). 
                 

      :rtype: `float`








   .. method:: GetStipple(self)

      Returns the pen's stipple bitmap. 
                 

      :rtype: :ref:`wx.Bitmap`








   .. method:: GetStops(self)

      Returns the stops of the gradient. 
                 

      :rtype: :ref:`wx.GraphicsGradientStops`








   .. method:: GetStyle(self)

      Returns the pen's style. 
                 

      :rtype: :ref:`wx.PenStyle`








   .. method:: GetWidth(self)

      Returns the pen's line width. 
                 

      :rtype: `float`








   .. method:: GetX1(self)

      Returns the x coordinate of the starting point (if using a gradient). 
                 

      :rtype: `float`








   .. method:: GetX2(self)

      Returns the x coordinate of the ending point (if using a gradient). 
                 

      :rtype: `float`








   .. method:: GetY1(self)

      Returns the y coordinate of the starting point (if using a gradient). 
                 

      :rtype: `float`








   .. method:: GetY2(self)

      Returns the y coordinate of the ending point (if using a gradient). 
                 

      :rtype: `float`








   .. method:: IsTransparent(self)

      Returns whether the pen is transparent. 
                 

      :rtype: `bool`








   .. method:: Join(self, join)

      Sets the join for the pen, which is the appearance of where two lines meet or overlap. 
                 


      :param `join`: 
      :type `join`: wx.PenJoin




      :rtype: :ref:`wx.GraphicsPenInfo`








   .. method:: LinearGradient(self, *args, **kw)



      |overload| **Overloaded Implementations:**

      :html:`<hr class="overloadsep" /><br />`

      
      **LinearGradient** `(self, x1, y1, x2, y2, c1, c2, matrix=NullGraphicsMatrix)`
      
      Applies a linear gradient to the pen. 
                       
      
      
      
      
      :param `x1`: The x coordinate of the starting point of the gradient.   
      :type `x1`: wx.Double
      :param `y1`: The y coordinate of the starting point of the gradient.   
      :type `y1`: wx.Double
      :param `x2`: The x coordinate of the ending point of the gradient.   
      :type `x2`: wx.Double
      :param `y2`: The y coordinate of the ending point of the gradient.   
      :type `y2`: wx.Double
      :param `c1`: The starting colour.   
      :type `c1`: wx.Colour
      :param `c2`: The ending colour.   
      :type `c2`: wx.Colour
      :param `matrix`: An optional transformation to apply to the gradient.  
      :type `matrix`: wx.GraphicsMatrix
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      :rtype: :ref:`wx.GraphicsPenInfo`
      
      
      
      
                        
      
      
      
      .. note:: 
      
         The starting and ending coordinates define the direction of the gradient. Along with north, south, east and west, diagonal directions can also be used.   
      
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`

      
      **LinearGradient** `(self, x1, y1, x2, y2, stops, matrix=NullGraphicsMatrix)`
      
      Applies a linear gradient to the pen, including discontinuous stops in the pattern. 
                       
      
      
      
      
      :param `x1`: The x coordinate of the starting point of the gradient.   
      :type `x1`: wx.Double
      :param `y1`: The y coordinate of the starting point of the gradient.   
      :type `y1`: wx.Double
      :param `x2`: The x coordinate of the ending point of the gradient.   
      :type `x2`: wx.Double
      :param `y2`: The y coordinate of the ending point of the gradient.   
      :type `y2`: wx.Double
      :param `stops`: A series of stops to include in the pattern.   
      :type `stops`: wx.GraphicsGradientStops
      :param `matrix`: An optional transformation to apply to the gradient.  
      :type `matrix`: wx.GraphicsMatrix
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      :rtype: :ref:`wx.GraphicsPenInfo`
      
      
      
      
                        
      
      
      
      .. note:: 
      
         The starting and ending coordinates define the direction of the gradient. Along with north, south, east and west, diagonal directions can also be used.   
      
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`






   .. method:: RadialGradient(self, *args, **kw)



      |overload| **Overloaded Implementations:**

      :html:`<hr class="overloadsep" /><br />`

      
      **RadialGradient** `(self, startX, startY, endX, endY, radius, oColor, cColor, matrix=NullGraphicsMatrix)`
      
      Applies a radial (i.e., circular) gradient to the pen. 
                       
      
      
      
      
      :param `startX`: The x coordinate of the starting point of the gradient.   
      :type `startX`: wx.Double
      :param `startY`: The startY coordinate of the starting point of the gradient.   
      :type `startY`: wx.Double
      :param `endX`: The endX coordinate of the end of the circle.   
      :type `endX`: wx.Double
      :param `endY`: The endY coordinate of the end of the circle.   
      :type `endY`: wx.Double
      :param `radius`: The radius of the circle of the gradient (around  `endX`  and  `endY`).   
      :type `radius`: wx.Double
      :param `oColor`: The outer colour.   
      :type `oColor`: wx.Colour
      :param `cColor`: The center colour.   
      :type `cColor`: wx.Colour
      :param `matrix`: An optional transformation to apply to the gradient.  
      :type `matrix`: wx.GraphicsMatrix
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      :rtype: :ref:`wx.GraphicsPenInfo`
      
      
      
      
                        
      
      
      
      .. note:: 
      
         The starting and ending coordinates define the direction of the gradient. Along with north, south, east and west, diagonal directions can also be used.   
      
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`

      
      **RadialGradient** `(self, startX, startY, endX, endY, radius, stops, matrix=NullGraphicsMatrix)`
      
      Applies a radial (i.e., circular) gradient to the pen, including discontinuous stops in the pattern. 
                       
      
      
      
      
      :param `startX`: The x coordinate of the starting point of the gradient.   
      :type `startX`: wx.Double
      :param `startY`: The startY coordinate of the starting point of the gradient.   
      :type `startY`: wx.Double
      :param `endX`: The endX coordinate of the end of the circle.   
      :type `endX`: wx.Double
      :param `endY`: The endY coordinate of the end of the circle.   
      :type `endY`: wx.Double
      :param `radius`: The radius of the circle of the gradient (around  `endX`  and  `endY`).   
      :type `radius`: wx.Double
      :param `stops`: A series of stops to include in the pattern.   
      :type `stops`: wx.GraphicsGradientStops
      :param `matrix`: An optional transformation to apply to the gradient.  
      :type `matrix`: wx.GraphicsMatrix
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      :rtype: :ref:`wx.GraphicsPenInfo`
      
      
      
      
                        
      
      
      
      .. note:: 
      
         The starting and ending coordinates define the direction of the gradient. Along with north, south, east and west, diagonal directions can also be used.   
      
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`






   .. method:: Stipple(self, stipple)

      Sets the bitmap used for stippling. 
                 

      When the pen is used, a repeating pattern of this bitmap will be drawn. 
                 


      :param `stipple`: 
      :type `stipple`: wx.Bitmap




      :rtype: :ref:`wx.GraphicsPenInfo`








   .. method:: Style(self, style)

      Sets the style for the pen. 
                 


      :param `style`: 
      :type `style`: wx.PenStyle




      :rtype: :ref:`wx.GraphicsPenInfo`








   .. method:: Width(self, width)

      Sets the line width for the pen. 
                 


      :param `width`: 
      :type `width`: wx.Double




      :rtype: :ref:`wx.GraphicsPenInfo`








   .. attribute:: EndX

      See :meth:`~wx.GraphicsPenInfo.GetEndX`


   .. attribute:: EndY

      See :meth:`~wx.GraphicsPenInfo.GetEndY`


   .. attribute:: GradientType

      See :meth:`~wx.GraphicsPenInfo.GetGradientType`


   .. attribute:: Radius

      See :meth:`~wx.GraphicsPenInfo.GetRadius`


   .. attribute:: StartX

      See :meth:`~wx.GraphicsPenInfo.GetStartX`


   .. attribute:: StartY

      See :meth:`~wx.GraphicsPenInfo.GetStartY`


   .. attribute:: Stops

      See :meth:`~wx.GraphicsPenInfo.GetStops`


   .. attribute:: X1

      See :meth:`~wx.GraphicsPenInfo.GetX1`


   .. attribute:: X2

      See :meth:`~wx.GraphicsPenInfo.GetX2`


   .. attribute:: Y1

      See :meth:`~wx.GraphicsPenInfo.GetY1`


   .. attribute:: Y2

      See :meth:`~wx.GraphicsPenInfo.GetY2`

