# C1.Win.Ribbon.C1Ribbon.GetPresetImage

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Win_Ribbon_C1Ribbon_GetPresetImage_" data-uid="C1.Win.Ribbon.C1Ribbon.GetPresetImage*">GetPresetImage Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Win_Ribbon_C1Ribbon_GetPresetImage_" data-uid="C1.Win.Ribbon.C1Ribbon.GetPresetImage*"></a>
<h4 id="C1_Win_Ribbon_C1Ribbon_GetPresetImage_System_String_System_Int32_" data-uid="C1.Win.Ribbon.C1Ribbon.GetPresetImage(System.String,System.Int32)">GetPresetImage(string, int)</h4>
<div class="markdown level1 summary"><p>Returns a bitmap image from build-in <a class="xref" href="C1.Win.Ribbon.C1Ribbon.html">C1Ribbon</a> presets for the current theme lightness.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public Image GetPresetImage(string key, int size)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function GetPresetImage(key As String, size As Integer) As Image</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.string">string</a></td>
      <td><span class="parametername">key</span></td>
      <td><p>The icon key.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">size</span></td>
      <td><p>The icon size</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="https://learn.microsoft.com/dotnet/api/system.drawing.image">Image</a></td>
      <td><p>The bitmap image from build-in <a class="xref" href="C1.Win.Ribbon.C1Ribbon.html">C1Ribbon</a> preset.
If image with specified key is not found, returns null.
If image with specified size is not found, returns the most appropriate image resized to the specified size.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Win_Ribbon_C1Ribbon_GetPresetImage_System_String_System_Int32__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>You have item with a icon from build-in preset:
ribbonButton1.IconSet.Add(new C1.Framework.C1BitmapIcon(&quot;Book&quot;, new System.Drawing.Size(32, 32), System.Drawing.Color.Transparent, &quot;Preset_LargeImages&quot;, 22));
You can get this image:
var bookImage = c1ribbon.GetPressetImage(ribbonButton1.IconSet[1].Key, 32);
The C1Ribbon contains 16px, 20px and 32px build-in presets.</p>
</div>


<a id="C1_Win_Ribbon_C1Ribbon_GetPresetImage_" data-uid="C1.Win.Ribbon.C1Ribbon.GetPresetImage*"></a>
<h4 id="C1_Win_Ribbon_C1Ribbon_GetPresetImage_System_String_System_Int32_System_Boolean_" data-uid="C1.Win.Ribbon.C1Ribbon.GetPresetImage(System.String,System.Int32,System.Boolean)">GetPresetImage(string, int, bool)</h4>
<div class="markdown level1 summary"><p>Returns a bitmap image from build-in <a class="xref" href="C1.Win.Ribbon.C1Ribbon.html">C1Ribbon</a> presets.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public Image GetPresetImage(string key, int size, bool isDarkTheme)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function GetPresetImage(key As String, size As Integer, isDarkTheme As Boolean) As Image</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.string">string</a></td>
      <td><span class="parametername">key</span></td>
      <td><p>The icon key.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">size</span></td>
      <td><p>The icon size</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">isDarkTheme</span></td>
      <td><p>Determines whether the icons are dark or not.</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="https://learn.microsoft.com/dotnet/api/system.drawing.image">Image</a></td>
      <td><p>The bitmap image from build-in <a class="xref" href="C1.Win.Ribbon.C1Ribbon.html">C1Ribbon</a> preset.
If image with specified key is not found, returns null.
If image with specified size is not found, returns the most appropriate image resized to the specified size.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Win_Ribbon_C1Ribbon_GetPresetImage_System_String_System_Int32_System_Boolean__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>You have item with a icon from build-in preset:
ribbonButton1.IconSet.Add(new C1.Framework.C1BitmapIcon(&quot;Book&quot;, new System.Drawing.Size(32, 32), System.Drawing.Color.Transparent, &quot;Preset_LargeImages&quot;, 22));
You can get this image:
var bookImage = c1ribbon.GetPressetImage(ribbonButton1.IconSet[1].Key, 32);
The C1Ribbon contains 16px, 20px and 32px build-in presets.</p>
</div>
</div>
