# GrapeCity.Documents.Imaging.GcBitmap.ToGrayscaleBitmap

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Documents_Imaging_GcBitmap_ToGrayscaleBitmap_" data-uid="GrapeCity.Documents.Imaging.GcBitmap.ToGrayscaleBitmap*">ToGrayscaleBitmap Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Documents_Imaging_GcBitmap_ToGrayscaleBitmap_" data-uid="GrapeCity.Documents.Imaging.GcBitmap.ToGrayscaleBitmap*"></a>
<h4 id="GrapeCity_Documents_Imaging_GcBitmap_ToGrayscaleBitmap_GrapeCity_Documents_Imaging_ColorChannel_System_Boolean_" data-uid="GrapeCity.Documents.Imaging.GcBitmap.ToGrayscaleBitmap(GrapeCity.Documents.Imaging.ColorChannel,System.Boolean)">ToGrayscaleBitmap(ColorChannel, bool)</h4>
<div class="markdown level1 summary"><p>Creates a <a class="xref" href="GrapeCity.Documents.Imaging.GrayscaleBitmap.html">GrayscaleBitmap</a> from the current <a class="xref" href="GrapeCity.Documents.Imaging.GcBitmap.html">GcBitmap</a>.</p>
<p>This method does not perform any transformations of the color palette.
It is expected that the source <a class="xref" href="GrapeCity.Documents.Imaging.GcBitmap.html">GcBitmap</a> has already been converted to
grayscale palette using a <a class="xref" href="GrapeCity.Documents.Imaging.GrayscaleEffect.html">GrayscaleEffect</a> or something like that.
Alternatively, you can use this method to extract individual channels of
a color image without any prior conversion, and treat the resulting <a class="xref" href="GrapeCity.Documents.Imaging.GrayscaleBitmap.html">GrayscaleBitmap</a>
simply as a representation of some image data with 8 bits per pixel.
The <a class="xref" href="GrapeCity.Documents.Imaging.GcBitmap.ToGrayscaleBitmap.html#GrapeCity_Documents_Imaging_GcBitmap_ToGrayscaleBitmap_GrapeCity_Documents_Imaging_ColorChannel_System_Boolean_">ToGrayscaleBitmap(ColorChannel, bool)</a> method just copies data from a specified color
channel to a new instance of the <a class="xref" href="GrapeCity.Documents.Imaging.GrayscaleBitmap.html">GrayscaleBitmap</a> class.
If you need to copy some color channel to an existing instance of <a class="xref" href="GrapeCity.Documents.Imaging.GrayscaleBitmap.html">GrayscaleBitmap</a>,
use the <a class="xref" href="GrapeCity.Documents.Imaging.GcBitmap.ExportColorChannel.html#GrapeCity_Documents_Imaging_GcBitmap_ExportColorChannel_GrapeCity_Documents_Imaging_GrayscaleBitmap_GrapeCity_Documents_Imaging_ColorChannel_">ExportColorChannel(GrayscaleBitmap, ColorChannel)</a> method instead.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public GrayscaleBitmap ToGrayscaleBitmap(ColorChannel colorChannel = ColorChannel.Blue, bool whiteIsZero = false)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function ToGrayscaleBitmap(Optional colorChannel As ColorChannel = ColorChannel.Blue, Optional whiteIsZero As Boolean = False) As GrayscaleBitmap</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="GrapeCity.Documents.Imaging.ColorChannel.html">ColorChannel</a></td>
      <td><span class="parametername">colorChannel</span></td>
      <td><p>The color channel used as the source of grayscale data.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">whiteIsZero</span></td>
      <td><p>If true, indicates that 0 represents white and 255 represents black in the resulting <a class="xref" href="GrapeCity.Documents.Imaging.GrayscaleBitmap.html">GrayscaleBitmap</a>.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="GrapeCity.Documents.Imaging.GrayscaleBitmap.html">GrayscaleBitmap</a></td>
      <td><p>A new instance of <a class="xref" href="GrapeCity.Documents.Imaging.GrayscaleBitmap.html">GrayscaleBitmap</a>.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
