# C1.Framework.Drawing.Gdi.DeviceContexts.DeviceContext.SetRasterOperationCode

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Framework_Drawing_Gdi_DeviceContexts_DeviceContext_SetRasterOperationCode_" data-uid="C1.Framework.Drawing.Gdi.DeviceContexts.DeviceContext.SetRasterOperationCode*">SetRasterOperationCode Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Framework_Drawing_Gdi_DeviceContexts_DeviceContext_SetRasterOperationCode_" data-uid="C1.Framework.Drawing.Gdi.DeviceContexts.DeviceContext.SetRasterOperationCode*"></a>
<h4 id="C1_Framework_Drawing_Gdi_DeviceContexts_DeviceContext_SetRasterOperationCode_C1_Framework_Drawing_Gdi_DeviceContexts_RasterOperationCode_" data-uid="C1.Framework.Drawing.Gdi.DeviceContexts.DeviceContext.SetRasterOperationCode(C1.Framework.Drawing.Gdi.DeviceContexts.RasterOperationCode)">SetRasterOperationCode(RasterOperationCode)</h4>
<div class="markdown level1 summary"><p>Sets the current foreground mix mode. GDI uses the foreground mix mode to combine pens and interiors of filled
objects with the colors already on the screen. The foreground mix mode defines how colors from the brush or pen
and the colors in the existing image are to be combined.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public virtual RasterOperationCode SetRasterOperationCode(RasterOperationCode rasterOperationCode)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Overridable Function SetRasterOperationCode(rasterOperationCode As RasterOperationCode) As RasterOperationCode</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.DeviceContexts.RasterOperationCode.html">RasterOperationCode</a></td>
      <td><span class="parametername">rasterOperationCode</span></td>
      <td><p>Specifies the mix mode. This parameter can be one of the following values.</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="C1.Framework.Drawing.Gdi.DeviceContexts.RasterOperationCode.html">RasterOperationCode</a></td>
      <td><p>If the function succeeds, the return value specifies the previous mix mode. otherwise, zero indicates failed</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Framework_Drawing_Gdi_DeviceContexts_DeviceContext_SetRasterOperationCode_C1_Framework_Drawing_Gdi_DeviceContexts_RasterOperationCode__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>Mix modes define how GDI combines source and destination colors when drawing with the current pen.
The mix modes are binary raster operation codes, representing all possible Boolean functions of two variables,
using the binary operations AND, OR, and XOR (exclusive OR), and the unary operation NOT. The mix mode is for
raster devices only; it is not available for vector devices.</p>
</div>
</div>
