# GrapeCity.Documents.Layout.Composition.Surface

## Content

<div class="doc-site-dotnet-api-container">



  <h1 id="GrapeCity_Documents_Layout_Composition_Surface" data-uid="GrapeCity.Documents.Layout.Composition.Surface" class="text-break">Surface Class
</h1>
  <div class="markdown level0 summary"><p>Represents a surface that can draw its views on a <a class="xref" href="GrapeCity.Documents.Drawing.GcGraphics.html">GcGraphics</a>.</p>
</div>
  <div class="markdown level0 conceptual"></div>
  <div class="inheritance">
    <h5>Inheritance</h5>
    <div class="level0"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></div>
    <div class="level1"><span class="xref">Surface</span></div>
  </div>
  <h6><strong>Namespace</strong>: <a class="xref" href="GrapeCity.Documents.Layout.Composition.html">GrapeCity.Documents.Layout.Composition</a></h6>
  <h6><strong>Assembly</strong>: DS.Documents.Imaging.dll</h6>
  <h5 id="GrapeCity_Documents_Layout_Composition_Surface_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public class Surface</code></pre>
  </div>
  <div class="codewrapper">
    <pre><code class="lang-vbnet hljs">Public Class Surface</code></pre>
  </div>
  <h3 id="constructors">Constructors
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="GrapeCity_Documents_Layout_Composition_Surface__ctor" data-uid="GrapeCity.Documents.Layout.Composition.Surface.#ctor">
          <a class="xref" href="GrapeCity.Documents.Layout.Composition.Surface.-ctor.html#GrapeCity_Documents_Layout_Composition_Surface__ctor">Surface()</a>
        </td>
        <td class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="GrapeCity.Documents.Layout.Composition.Surface.html">Surface</a> object with a <a class="xref" href="GrapeCity.Documents.Layout.LayoutHost.html">LayoutHost</a>.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="properties">Properties
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="GrapeCity_Documents_Layout_Composition_Surface_BaseTransform" data-uid="GrapeCity.Documents.Layout.Composition.Surface.BaseTransform">
          <a class="xref" href="GrapeCity.Documents.Layout.Composition.Surface.BaseTransform.html#GrapeCity_Documents_Layout_Composition_Surface_BaseTransform">BaseTransform</a>
        </td>
        <td class="markdown level1 summary"><p>Gets the transformation matrix of the <a class="xref" href="GrapeCity.Documents.Drawing.GcGraphics.html">GcGraphics</a> object when it was passed to the <a class="xref" href="GrapeCity.Documents.Layout.Composition.Surface.Render.html#GrapeCity_Documents_Layout_Composition_Surface_Render_GrapeCity_Documents_Drawing_GcGraphics_">Render(GcGraphics)</a> method.</p>
<p>Returns an identity matrix when checked outside of the <a class="xref" href="GrapeCity.Documents.Layout.Composition.Surface.Render.html#GrapeCity_Documents_Layout_Composition_Surface_Render_GrapeCity_Documents_Drawing_GcGraphics_">Render(GcGraphics)</a> method.</p>
</td>
      </tr>
      <tr>
        <td id="GrapeCity_Documents_Layout_Composition_Surface_BottomLayer" data-uid="GrapeCity.Documents.Layout.Composition.Surface.BottomLayer">
          <a class="xref" href="GrapeCity.Documents.Layout.Composition.Surface.BottomLayer.html#GrapeCity_Documents_Layout_Composition_Surface_BottomLayer">BottomLayer</a>
        </td>
        <td class="markdown level1 summary"><p>Gets the view that appears below all other views on this <a class="xref" href="GrapeCity.Documents.Layout.Composition.Surface.html">Surface</a>.</p>
</td>
      </tr>
      <tr>
        <td id="GrapeCity_Documents_Layout_Composition_Surface_LayoutHost" data-uid="GrapeCity.Documents.Layout.Composition.Surface.LayoutHost">
          <a class="xref" href="GrapeCity.Documents.Layout.Composition.Surface.LayoutHost.html#GrapeCity_Documents_Layout_Composition_Surface_LayoutHost">LayoutHost</a>
        </td>
        <td class="markdown level1 summary"><p>Gets the associated <a class="xref" href="GrapeCity.Documents.Layout.LayoutHost.html">LayoutHost</a> object.</p>
</td>
      </tr>
      <tr>
        <td id="GrapeCity_Documents_Layout_Composition_Surface_Name" data-uid="GrapeCity.Documents.Layout.Composition.Surface.Name">
          <a class="xref" href="GrapeCity.Documents.Layout.Composition.Surface.Name.html#GrapeCity_Documents_Layout_Composition_Surface_Name">Name</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets the name of the <a class="xref" href="GrapeCity.Documents.Layout.Composition.Surface.html">Surface</a>.</p>
</td>
      </tr>
      <tr>
        <td id="GrapeCity_Documents_Layout_Composition_Surface_Tag" data-uid="GrapeCity.Documents.Layout.Composition.Surface.Tag">
          <a class="xref" href="GrapeCity.Documents.Layout.Composition.Surface.Tag.html#GrapeCity_Documents_Layout_Composition_Surface_Tag">Tag</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets an object that contains arbitrary data associated with this surface.</p>
</td>
      </tr>
      <tr>
        <td id="GrapeCity_Documents_Layout_Composition_Surface_ThrowIfNotFit" data-uid="GrapeCity.Documents.Layout.Composition.Surface.ThrowIfNotFit">
          <a class="xref" href="GrapeCity.Documents.Layout.Composition.Surface.ThrowIfNotFit.html#GrapeCity_Documents_Layout_Composition_Surface_ThrowIfNotFit">ThrowIfNotFit</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets a value indicating whether a <a class="xref" href="GrapeCity.Documents.Layout.LayoutException.html">LayoutException</a> should be thrown
if the width or height of some <a class="xref" href="GrapeCity.Documents.Layout.LayoutRect.html">LayoutRect</a>s becomes negative.</p>
<p>The default is <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">true</a>.</p>
</td>
      </tr>
      <tr>
        <td id="GrapeCity_Documents_Layout_Composition_Surface_TopLayer" data-uid="GrapeCity.Documents.Layout.Composition.Surface.TopLayer">
          <a class="xref" href="GrapeCity.Documents.Layout.Composition.Surface.TopLayer.html#GrapeCity_Documents_Layout_Composition_Surface_TopLayer">TopLayer</a>
        </td>
        <td class="markdown level1 summary"><p>Gets the view that appears above all other views on this <a class="xref" href="GrapeCity.Documents.Layout.Composition.Surface.html">Surface</a>.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="methods">Methods
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="GrapeCity_Documents_Layout_Composition_Surface_CreateView_System_Single_System_Single_" data-uid="GrapeCity.Documents.Layout.Composition.Surface.CreateView(System.Single,System.Single)">
          <a class="xref" href="GrapeCity.Documents.Layout.Composition.Surface.CreateView.html#GrapeCity_Documents_Layout_Composition_Surface_CreateView_System_Single_System_Single_">CreateView(float, float)</a>
        </td>
        <td class="markdown level1 summary"><p>Creates a <a class="xref" href="GrapeCity.Documents.Layout.Composition.View.html">View</a> object that encapsulates a <a class="xref" href="GrapeCity.Documents.Layout.LayoutView.html">LayoutView</a> and adds it as the top layer.</p>
</td>
      </tr>
      <tr>
        <td id="GrapeCity_Documents_Layout_Composition_Surface_CreateView_System_Single_System_Single_System_Action_GrapeCity_Documents_Drawing_GcGraphics_GrapeCity_Documents_Layout_Composition_Layer__" data-uid="GrapeCity.Documents.Layout.Composition.Surface.CreateView(System.Single,System.Single,System.Action{GrapeCity.Documents.Drawing.GcGraphics,GrapeCity.Documents.Layout.Composition.Layer})">
          <a class="xref" href="GrapeCity.Documents.Layout.Composition.Surface.CreateView.html#GrapeCity_Documents_Layout_Composition_Surface_CreateView_System_Single_System_Single_System_Action_GrapeCity_Documents_Drawing_GcGraphics_GrapeCity_Documents_Layout_Composition_Layer__">CreateView(float, float, Action&lt;GcGraphics, Layer&gt;)</a>
        </td>
        <td class="markdown level1 summary"><p>Creates a <a class="xref" href="GrapeCity.Documents.Layout.Composition.View.html">View</a> object that encapsulates a <a class="xref" href="GrapeCity.Documents.Layout.LayoutView.html">LayoutView</a> and adds it as the top layer.</p>
</td>
      </tr>
      <tr>
        <td id="GrapeCity_Documents_Layout_Composition_Surface_GetViews" data-uid="GrapeCity.Documents.Layout.Composition.Surface.GetViews">
          <a class="xref" href="GrapeCity.Documents.Layout.Composition.Surface.GetViews.html#GrapeCity_Documents_Layout_Composition_Surface_GetViews">GetViews()</a>
        </td>
        <td class="markdown level1 summary"><p>Returns the array of views on this <a class="xref" href="GrapeCity.Documents.Layout.Composition.Surface.html">Surface</a>.</p>
</td>
      </tr>
      <tr>
        <td id="GrapeCity_Documents_Layout_Composition_Surface_PerformLayout" data-uid="GrapeCity.Documents.Layout.Composition.Surface.PerformLayout">
          <a class="xref" href="GrapeCity.Documents.Layout.Composition.Surface.PerformLayout.html#GrapeCity_Documents_Layout_Composition_Surface_PerformLayout">PerformLayout()</a>
        </td>
        <td class="markdown level1 summary"><p>Recalculates the layout of all <a class="xref" href="GrapeCity.Documents.Layout.Composition.Visual.html">Visual</a> and <a class="xref" href="GrapeCity.Documents.Layout.Composition.Space.html">Space</a> objects on this <a class="xref" href="GrapeCity.Documents.Layout.Composition.Surface.html">Surface</a>.</p>
</td>
      </tr>
      <tr>
        <td id="GrapeCity_Documents_Layout_Composition_Surface_Render_GrapeCity_Documents_Drawing_GcGraphics_" data-uid="GrapeCity.Documents.Layout.Composition.Surface.Render(GrapeCity.Documents.Drawing.GcGraphics)">
          <a class="xref" href="GrapeCity.Documents.Layout.Composition.Surface.Render.html#GrapeCity_Documents_Layout_Composition_Surface_Render_GrapeCity_Documents_Drawing_GcGraphics_">Render(GcGraphics)</a>
        </td>
        <td class="markdown level1 summary"><p>Draws this <a class="xref" href="GrapeCity.Documents.Layout.Composition.Surface.html">Surface</a> on a specified <a class="xref" href="GrapeCity.Documents.Drawing.GcGraphics.html">GcGraphics</a> object.</p>
<p>
This method first calls <a class="xref" href="GrapeCity.Documents.Layout.Composition.Surface.PerformLayout.html#GrapeCity_Documents_Layout_Composition_Surface_PerformLayout">PerformLayout()</a>, if the call succeeds it then draws all layers
starting with the bottom layer and going up. For each layer, it draws all visuals from the bottom to the top one,
followed by drawing the layer's sub-layers. The process repeats until the topmost visual of the top layer
has been drawn.
</p>
</td>
      </tr>
      <tr>
        <td id="GrapeCity_Documents_Layout_Composition_Surface_ToString" data-uid="GrapeCity.Documents.Layout.Composition.Surface.ToString">
          <a class="xref" href="GrapeCity.Documents.Layout.Composition.Surface.ToString.html#GrapeCity_Documents_Layout_Composition_Surface_ToString">ToString()</a>
        </td>
        <td class="markdown level1 summary"><p>Returns a string that represents the current <a class="xref" href="GrapeCity.Documents.Layout.Composition.Surface.html">Surface</a>.</p>
</td>
      </tr>
    </tbody>
  </table>

</div>
