# C1.Framework.Drawing.Gdi.ColorPen

## Content

<div class="doc-site-dotnet-api-container">



  <h1 id="C1_Framework_Drawing_Gdi_ColorPen" data-uid="C1.Framework.Drawing.Gdi.ColorPen" class="text-break">ColorPen Class
</h1>
  <div class="markdown level0 summary"><p>Defines a brush that has a solid color.</p>
</div>
  <div class="markdown level0 conceptual"></div>
  <div class="inheritance">
    <h5>Inheritance</h5>
    <div class="level0"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></div>
    <div class="level1"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.marshalbyrefobject">MarshalByRefObject</a></div>
    <div class="level2"><a class="xref" href="C1.Framework.Drawing.Gdi.GdiObject.html">GdiObject</a></div>
    <div class="level3"><a class="xref" href="C1.Framework.Drawing.Gdi.Pen.html">Pen</a></div>
    <div class="level4"><span class="xref">ColorPen</span></div>
  </div>
  <div class="implements">
    <h5>Implements</h5>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.idisposable">IDisposable</a></div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.icloneable">ICloneable</a></div>
  </div>
  <h6><strong>Namespace</strong>: <a class="xref" href="C1.Framework.Drawing.Gdi.html">C1.Framework.Drawing.Gdi</a></h6>
  <h6><strong>Assembly</strong>: C1.Win.C1Input.4.8.dll</h6>
  <h5 id="C1_Framework_Drawing_Gdi_ColorPen_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public sealed class ColorPen : Pen, IDisposable, ICloneable</code></pre>
  </div>
  <div class="codewrapper">
    <pre><code class="lang-vbnet hljs">Public NotInheritable Class ColorPen
    Inherits Pen
    Implements IDisposable, ICloneable</code></pre>
  </div>
  <h5 id="C1_Framework_Drawing_Gdi_ColorPen_remarks"><strong>Remarks</strong></h5>
  <div class="markdown level0 remarks"><p>This pen has the same funtion as <a class="xref" href="C1.Framework.Drawing.Gdi.SolidPen.html">SolidPen</a> in painting. The width of <a class="xref" href="C1.Framework.Drawing.Gdi.SolidPen.html">SolidPen</a> is always 1.
This pen will not consume gdi handle. In other word, the Handle property is always IntPtr.Zero. So it
can not be used to <a class="xref" href="C1.Framework.Drawing.Gdi.DeviceContexts.DeviceContext.html">DeviceContext</a>.</p>
</div>
  <h3 id="constructors">Constructors
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_Framework_Drawing_Gdi_ColorPen__ctor_System_Drawing_Color_" data-uid="C1.Framework.Drawing.Gdi.ColorPen.#ctor(System.Drawing.Color)">
          <a class="xref" href="C1.Framework.Drawing.Gdi.ColorPen.-ctor.html#C1_Framework_Drawing_Gdi_ColorPen__ctor_System_Drawing_Color_">ColorPen(Color)</a>
        </td>
        <td class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="C1.Framework.Drawing.Gdi.ColorPen.html">ColorPen</a> class.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="properties">Properties
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_Framework_Drawing_Gdi_ColorPen_Color" data-uid="C1.Framework.Drawing.Gdi.ColorPen.Color">
          <a class="xref" href="C1.Framework.Drawing.Gdi.ColorPen.Color.html#C1_Framework_Drawing_Gdi_ColorPen_Color">Color</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets the color of the pen.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="methods">Methods
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_Framework_Drawing_Gdi_ColorPen_Clone" data-uid="C1.Framework.Drawing.Gdi.ColorPen.Clone">
          <a class="xref" href="C1.Framework.Drawing.Gdi.ColorPen.Clone.html#C1_Framework_Drawing_Gdi_ColorPen_Clone">Clone()</a>
        </td>
        <td class="markdown level1 summary"><p>Creates an exact copy if this <b>ColorPen</b> object.</p>
</td>
      </tr>
    </tbody>
  </table>

</div>
