# C1.C1Excel.C1XLBook.PixelsToTwips

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_C1Excel_C1XLBook_PixelsToTwips_" data-uid="C1.C1Excel.C1XLBook.PixelsToTwips*">PixelsToTwips Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_C1Excel_C1XLBook_PixelsToTwips_" data-uid="C1.C1Excel.C1XLBook.PixelsToTwips*"></a>
<h4 id="C1_C1Excel_C1XLBook_PixelsToTwips_System_Double_" data-uid="C1.C1Excel.C1XLBook.PixelsToTwips(System.Double)">PixelsToTwips(double)</h4>
<div class="markdown level1 summary"><p>Converts a pixel measurement into twips (1/20th of a point).</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static int PixelsToTwips(double pix)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function PixelsToTwips(pix As Double) 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.double">double</a></td>
      <td><span class="parametername">pix</span></td>
      <td><p>Measurement in screen pixels.</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.int32">int</a></td>
      <td><p>Measurement in twips.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_C1Excel_C1XLBook_PixelsToTwips_System_Double__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>Excel stores measurements in twips (1/20th of a point), a 
resolution-independent unit. .NET controls, on the other hand, usually 
express measurements in pixels. This method provides an easy way to 
convert pixel measurements into twips using the current screen resolution.</p>
<a class="xref" href="C1.C1Excel.C1XLBook.TwipsToPixels.html#C1_C1Excel_C1XLBook_TwipsToPixels_System_Double_">TwipsToPixels(double)</a>
</div>
</div>
