# C1.Framework.Drawing.Gdi.Bitmap.-ctor

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Framework_Drawing_Gdi_Bitmap__ctor_" data-uid="C1.Framework.Drawing.Gdi.Bitmap.#ctor*">Bitmap Constructor
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Framework_Drawing_Gdi_Bitmap__ctor_" data-uid="C1.Framework.Drawing.Gdi.Bitmap.#ctor*"></a>
<h4 id="C1_Framework_Drawing_Gdi_Bitmap__ctor_System_Int32_System_Int32_" data-uid="C1.Framework.Drawing.Gdi.Bitmap.#ctor(System.Int32,System.Int32)">Bitmap(int, int)</h4>
<div class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="C1.Framework.Drawing.Gdi.Bitmap.html">Bitmap</a> class
with the specified size.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public Bitmap(int width, int height)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New(width As Integer, height As Integer)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">width</span></td>
      <td><p>The width, in pixels, of the new <a class="xref" href="C1.Framework.Drawing.Gdi.Bitmap.html">Bitmap</a> object.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">height</span></td>
      <td><p>The height, in pixels, of the new <a class="xref" href="C1.Framework.Drawing.Gdi.Bitmap.html">Bitmap</a> object.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Framework_Drawing_Gdi_Bitmap__ctor_" data-uid="C1.Framework.Drawing.Gdi.Bitmap.#ctor*"></a>
<h4 id="C1_Framework_Drawing_Gdi_Bitmap__ctor_System_Int32_System_Int32_C1_Framework_Drawing_Gdi_BitsPerPixel_" data-uid="C1.Framework.Drawing.Gdi.Bitmap.#ctor(System.Int32,System.Int32,C1.Framework.Drawing.Gdi.BitsPerPixel)">Bitmap(int, int, BitsPerPixel)</h4>
<div class="markdown level1 summary"><p>Intializes a new instance of the <a class="xref" href="C1.Framework.Drawing.Gdi.Bitmap.html">Bitmap</a> class
with the specified size color format (color planes and bits-per-pixel).</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public Bitmap(int width, int height, BitsPerPixel bitsPerPixel)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New(width As Integer, height As Integer, bitsPerPixel As BitsPerPixel)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">width</span></td>
      <td><p>The width, in pixels, of the new <a class="xref" href="C1.Framework.Drawing.Gdi.Bitmap.html">Bitmap</a> object.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">height</span></td>
      <td><p>The height, in pixels, of the new <a class="xref" href="C1.Framework.Drawing.Gdi.Bitmap.html">Bitmap</a> object.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Framework.Drawing.Gdi.BitsPerPixel.html">BitsPerPixel</a></td>
      <td><span class="parametername">bitsPerPixel</span></td>
      <td><p>The number of bits required to identify the color of a single pixel.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Framework_Drawing_Gdi_Bitmap__ctor_" data-uid="C1.Framework.Drawing.Gdi.Bitmap.#ctor*"></a>
<h4 id="C1_Framework_Drawing_Gdi_Bitmap__ctor_System_Int32_System_Int32_System_Int32_C1_Framework_Drawing_Gdi_BitsPerPixel_System_Byte___" data-uid="C1.Framework.Drawing.Gdi.Bitmap.#ctor(System.Int32,System.Int32,System.Int32,C1.Framework.Drawing.Gdi.BitsPerPixel,System.Byte[])">Bitmap(int, int, int, BitsPerPixel, byte[])</h4>
<div class="markdown level1 summary"><p>Intializes a new instance of the <a class="xref" href="C1.Framework.Drawing.Gdi.Bitmap.html">Bitmap</a> class
with the specified size color format (color planes and bits-per-pixel).</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public Bitmap(int width, int height, int planes, BitsPerPixel bitsPerPixel, byte[] data)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New(width As Integer, height As Integer, planes As Integer, bitsPerPixel As BitsPerPixel, data As Byte())</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">width</span></td>
      <td><p>The width, in pixels, of the new <a class="xref" href="C1.Framework.Drawing.Gdi.Bitmap.html">Bitmap</a> object.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">height</span></td>
      <td><p>The height, in pixels, of the new <a class="xref" href="C1.Framework.Drawing.Gdi.Bitmap.html">Bitmap</a> object.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">planes</span></td>
      <td><p>Specifies the number of planes for the target device. This value must be set to 1.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Framework.Drawing.Gdi.BitsPerPixel.html">BitsPerPixel</a></td>
      <td><span class="parametername">bitsPerPixel</span></td>
      <td><p>The number of bits required to identify the color of a single pixel.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.byte">byte</a>[]</td>
      <td><span class="parametername">data</span></td>
      <td><p>The pattern data array.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Framework_Drawing_Gdi_Bitmap__ctor_" data-uid="C1.Framework.Drawing.Gdi.Bitmap.#ctor*"></a>
<h4 id="C1_Framework_Drawing_Gdi_Bitmap__ctor_C1_Framework_Drawing_Gdi_Graphics_System_Int32_System_Int32_" data-uid="C1.Framework.Drawing.Gdi.Bitmap.#ctor(C1.Framework.Drawing.Gdi.Graphics,System.Int32,System.Int32)">Bitmap(Graphics, int, int)</h4>
<div class="markdown level1 summary"><p>Intializes a new instance of the <a class="xref" href="C1.Framework.Drawing.Gdi.Bitmap.html">Bitmap</a> class
with the specified <a class="xref" href="C1.Framework.Drawing.Gdi.Graphics.html">Graphics</a> object and size.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public Bitmap(Graphics graphics, int width, int height)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New(graphics As Graphics, width As Integer, height As Integer)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.Framework.Drawing.Gdi.Graphics.html">Graphics</a></td>
      <td><span class="parametername">graphics</span></td>
      <td><p>A <a class="xref" href="C1.Framework.Drawing.Gdi.Graphics.html">Graphics</a> object.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">width</span></td>
      <td><p>The width, in pixels, of the new <a class="xref" href="C1.Framework.Drawing.Gdi.Bitmap.html">Bitmap</a> object.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">height</span></td>
      <td><p>The height, in pixels, of the new <a class="xref" href="C1.Framework.Drawing.Gdi.Bitmap.html">Bitmap</a> object.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Framework_Drawing_Gdi_Bitmap__ctor_" data-uid="C1.Framework.Drawing.Gdi.Bitmap.#ctor*"></a>
<h4 id="C1_Framework_Drawing_Gdi_Bitmap__ctor_System_Drawing_Bitmap_" data-uid="C1.Framework.Drawing.Gdi.Bitmap.#ctor(System.Drawing.Bitmap)">Bitmap(Bitmap)</h4>
<div class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="C1.Framework.Drawing.Gdi.Bitmap.html">Bitmap</a> class.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public Bitmap(Bitmap gdiplusBitmap)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New(gdiplusBitmap As Bitmap)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.bitmap">Bitmap</a></td>
      <td><span class="parametername">gdiplusBitmap</span></td>
      <td><p>A <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.bitmap">Bitmap</a> indicates the GDI+ bitmap.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Framework_Drawing_Gdi_Bitmap__ctor_" data-uid="C1.Framework.Drawing.Gdi.Bitmap.#ctor*"></a>
<h4 id="C1_Framework_Drawing_Gdi_Bitmap__ctor_System_Drawing_Bitmap_System_Drawing_Color_" data-uid="C1.Framework.Drawing.Gdi.Bitmap.#ctor(System.Drawing.Bitmap,System.Drawing.Color)">Bitmap(Bitmap, Color)</h4>
<div class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="C1.Framework.Drawing.Gdi.Bitmap.html">Bitmap</a> class.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public Bitmap(Bitmap gdiplusBitmap, Color backgroundColor)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New(gdiplusBitmap As Bitmap, backgroundColor As Color)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.bitmap">Bitmap</a></td>
      <td><span class="parametername">gdiplusBitmap</span></td>
      <td><p>A <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.bitmap">Bitmap</a> indicates the GDI+ bitmap.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.color">Color</a></td>
      <td><span class="parametername">backgroundColor</span></td>
      <td><p>A <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.color">Color</a> structure that specifies the background color. This
parameter is ignored if the bitmap is totally opaque.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
