# C1.Util.DX.Direct2D.GradientStopCollection1.Create

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Util_DX_Direct2D_GradientStopCollection1_Create_" data-uid="C1.Util.DX.Direct2D.GradientStopCollection1.Create*">Create Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Util_DX_Direct2D_GradientStopCollection1_Create_" data-uid="C1.Util.DX.Direct2D.GradientStopCollection1.Create*"></a>
<h4 id="C1_Util_DX_Direct2D_GradientStopCollection1_Create_C1_Util_DX_Direct2D_DeviceContext_C1_Util_DX_Direct2D_GradientStop___C1_Util_DX_Direct2D_ColorSpace_C1_Util_DX_Direct2D_ColorSpace_C1_Util_DX_Direct2D_BufferPrecision_C1_Util_DX_Direct2D_ExtendMode_C1_Util_DX_Direct2D_ColorInterpolationMode_" data-uid="C1.Util.DX.Direct2D.GradientStopCollection1.Create(C1.Util.DX.Direct2D.DeviceContext,C1.Util.DX.Direct2D.GradientStop[],C1.Util.DX.Direct2D.ColorSpace,C1.Util.DX.Direct2D.ColorSpace,C1.Util.DX.Direct2D.BufferPrecision,C1.Util.DX.Direct2D.ExtendMode,C1.Util.DX.Direct2D.ColorInterpolationMode)">Create(DeviceContext, GradientStop[], ColorSpace, ColorSpace, BufferPrecision, ExtendMode, ColorInterpolationMode)</h4>
<div class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="C1.Util.DX.Direct2D.GradientStopCollection1.html">GradientStopCollection1</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 static GradientStopCollection1 Create(DeviceContext context, GradientStop[] straightAlphaGradientStops, ColorSpace preInterpolationSpace, ColorSpace postInterpolationSpace, BufferPrecision bufferPrecision, ExtendMode extendMode, ColorInterpolationMode colorInterpolationMode)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function Create(context As DeviceContext, straightAlphaGradientStops As GradientStop(), preInterpolationSpace As ColorSpace, postInterpolationSpace As ColorSpace, bufferPrecision As BufferPrecision, extendMode As ExtendMode, colorInterpolationMode As ColorInterpolationMode) As GradientStopCollection1</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.Util.DX.Direct2D.DeviceContext.html">DeviceContext</a></td>
      <td><span class="parametername">context</span></td>
      <td><p>The context.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Direct2D.GradientStop.html">GradientStop</a>[]</td>
      <td><span class="parametername">straightAlphaGradientStops</span></td>
      <td><p>An array of color values and offsets.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Direct2D.ColorSpace.html">ColorSpace</a></td>
      <td><span class="parametername">preInterpolationSpace</span></td>
      <td><p>Specifies both the input color space and the space in which the color interpolation occurs.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Direct2D.ColorSpace.html">ColorSpace</a></td>
      <td><span class="parametername">postInterpolationSpace</span></td>
      <td><p>The color space that colors will be converted to after interpolation occurs.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Direct2D.BufferPrecision.html">BufferPrecision</a></td>
      <td><span class="parametername">bufferPrecision</span></td>
      <td><p>The precision of the texture used to hold interpolated values.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Direct2D.ExtendMode.html">ExtendMode</a></td>
      <td><span class="parametername">extendMode</span></td>
      <td><p>Defines how colors outside of the range defined by the stop collection are determined.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Direct2D.ColorInterpolationMode.html">ColorInterpolationMode</a></td>
      <td><span class="parametername">colorInterpolationMode</span></td>
      <td><p>The new gradient stop collection.</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.Util.DX.Direct2D.GradientStopCollection1.html">GradientStopCollection1</a></td>
      <td></td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Util_DX_Direct2D_GradientStopCollection1_Create_C1_Util_DX_Direct2D_DeviceContext_C1_Util_DX_Direct2D_GradientStop___C1_Util_DX_Direct2D_ColorSpace_C1_Util_DX_Direct2D_ColorSpace_C1_Util_DX_Direct2D_BufferPrecision_C1_Util_DX_Direct2D_ExtendMode_C1_Util_DX_Direct2D_ColorInterpolationMode__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>This method linearly interpolates between the color stops. An optional color space conversion is applied after interpolation. Whether and how this gamma conversion is applied is determined before and after interpolation. This method will fail if the device context does not support the requested buffer precision.Additional ReferencesD2D1_GRADIENT_STOP, D2D1_GAMMA_CONVERSION, <a class="xref" href="C1.Util.DX.Direct2D.BufferPrecision.html">BufferPrecision</a>, <a class="xref" href="C1.Util.DX.Direct2D.ExtendMode.html">ExtendMode</a>, <a class="xref" href="C1.Util.DX.Direct2D.GradientStopCollection.html">GradientStopCollection</a>RequirementsMinimum supported operating systemSame as Interface / Class Highest IRQL levelN/A (user mode) Callable from DlllMain()No Callable from services and session 0Yes Callable from UI threadYes?</p>
</div>
</div>
