# HtmlRenderSurface

Immutable executable view over one retained HTML output surface. Preview, geometry, automation, and encoder consumers share this view and its source mapping.

Class 

`OfficeIMO.Html`

**Namespace**

`OfficeIMO.Html`

**Assembly**

`OfficeIMO.Html`

**Source revision**

`3b680b1b6fb1` with working tree changes

**Source**

[HtmlRenderSurface.cs:32](https://github.com/EvotecIT/OfficeIMO/blob/3b680b1b6fb15a268ff5525a4ca6cdd70b2f6613/OfficeIMO.Html/Rendering/HtmlRenderSurface.cs#L32)

**Modifiers**

sealed

Immutable executable view over one retained HTML output surface. Preview, geometry, automation, and encoder consumers share this view and its source mapping.

## Inheritance

- object
- HtmlRenderSurface

## Usage

Explore 3 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 3

- Property [HtmlRenderHitTestResult.Surface](/api/html/officeimo-html-htmlrenderhittestresult/#property-surface)
- Method [HtmlRenderResult.GetSurface](/api/html/officeimo-html-htmlrenderresult/#method-getsurface-int32)
- Property [HtmlRenderResult.OutputSurfaces](/api/html/officeimo-html-htmlrenderresult/#property-outputsurfaces)

Filter members 

Show inherited

## Methods

CreateDrawing 2 overloads

`public OfficeDrawing CreateDrawing()` [#](#method-createdrawing)

[HtmlRenderSurface.cs:32](https://github.com/EvotecIT/OfficeIMO/blob/3b680b1b6fb15a268ff5525a4ca6cdd70b2f6613/OfficeIMO.Html/Rendering/HtmlRenderSurface.cs#L32)

Creates a detached Drawing preview of this surface.

Returns

`OfficeDrawing`

`public OfficeDrawing CreateDrawing(CancellationToken cancellationToken)` [#](#method-createdrawing-threading-cancellationtoken)

[HtmlRenderSurface.cs:35](https://github.com/EvotecIT/OfficeIMO/blob/3b680b1b6fb15a268ff5525a4ca6cdd70b2f6613/OfficeIMO.Html/Rendering/HtmlRenderSurface.cs#L35)

Creates a detached Drawing preview with cooperative cancellation.

Parameters

**cancellationToken System.Threading.CancellationToken required**

Returns

`OfficeDrawing`

HitTest 2 overloads

`public HtmlRenderHitTestReport HitTest(HtmlRenderPoint point, HtmlRenderHitTestOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-hittest-officeimo-html-htmlrenderpoint-officeimo-html-htmlrenderhittestoptions-threading-cancellationtoken)

[HtmlRenderSurface.cs:48](https://github.com/EvotecIT/OfficeIMO/blob/3b680b1b6fb15a268ff5525a4ca6cdd70b2f6613/OfficeIMO.Html/Rendering/HtmlRenderSurface.cs#L48)

Runs a bounded, topmost-first hit test against the retained scene.

Parameters

**point OfficeIMO.Html.HtmlRenderPoint required**

**options OfficeIMO.Html.HtmlRenderHitTestOptions? = null optional**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`HtmlRenderHitTestReport`

`public HtmlRenderHitTestReport HitTest(double x, double y, HtmlRenderHitTestOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-hittest-double-double-officeimo-html-htmlrenderhittestoptions-threading-cancellationtoken)

[HtmlRenderSurface.cs:53](https://github.com/EvotecIT/OfficeIMO/blob/3b680b1b6fb15a268ff5525a4ca6cdd70b2f6613/OfficeIMO.Html/Rendering/HtmlRenderSurface.cs#L53)

Runs a bounded, topmost-first hit test at finite surface coordinates.

Parameters

**x double required**

**y double required**

**options OfficeIMO.Html.HtmlRenderHitTestOptions? = null optional**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`HtmlRenderHitTestReport`

`public HtmlRenderHitTestResult? HitTestTopmost(HtmlRenderPoint point, HtmlRenderHitTestOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-hittesttopmost-officeimo-html-htmlrenderpoint-officeimo-html-htmlrenderhittestoptions-threading-cancellationtoken)

[HtmlRenderSurface.cs:58](https://github.com/EvotecIT/OfficeIMO/blob/3b680b1b6fb15a268ff5525a4ca6cdd70b2f6613/OfficeIMO.Html/Rendering/HtmlRenderSurface.cs#L58)

Returns the topmost matching visual, or null.

Parameters

**point OfficeIMO.Html.HtmlRenderPoint required**

**options OfficeIMO.Html.HtmlRenderHitTestOptions? = null optional**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`HtmlRenderHitTestResult?`

TryMapToSource 2 overloads

`public bool TryMapToSource(HtmlRenderPoint outputPoint, out HtmlRenderSourcePoint? sourcePoint)` [#](#method-trymaptosource-officeimo-html-htmlrenderpoint-officeimo-html-htmlrendersourcepoint)

[HtmlRenderSurface.cs:39](https://github.com/EvotecIT/OfficeIMO/blob/3b680b1b6fb15a268ff5525a4ca6cdd70b2f6613/OfficeIMO.Html/Rendering/HtmlRenderSurface.cs#L39)

Maps an output point to the source page or source-canvas slice.

Parameters

**outputPoint OfficeIMO.Html.HtmlRenderPoint required**

**sourcePoint OfficeIMO.Html.HtmlRenderSourcePoint? required**

Returns

`bool`

`public bool TryMapToSource(double x, double y, out HtmlRenderSourcePoint? sourcePoint)` [#](#method-trymaptosource-double-double-officeimo-html-htmlrendersourcepoint)

[HtmlRenderSurface.cs:43](https://github.com/EvotecIT/OfficeIMO/blob/3b680b1b6fb15a268ff5525a4ca6cdd70b2f6613/OfficeIMO.Html/Rendering/HtmlRenderSurface.cs#L43)

Maps finite output coordinates to the source page or source-canvas slice.

Parameters

**x double required**

**y double required**

**sourcePoint OfficeIMO.Html.HtmlRenderSourcePoint? required**

Returns

`bool`

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

## Properties

`public int OutputIndex { get; }` [#](#property-outputindex)

[HtmlRenderSurface.cs:19](https://github.com/EvotecIT/OfficeIMO/blob/3b680b1b6fb15a268ff5525a4ca6cdd70b2f6613/OfficeIMO.Html/Rendering/HtmlRenderSurface.cs#L19)

Zero-based position in the resolved output set.

`public HtmlRenderPage Page { get; }` [#](#property-page)

[HtmlRenderSurface.cs:21](https://github.com/EvotecIT/OfficeIMO/blob/3b680b1b6fb15a268ff5525a4ca6cdd70b2f6613/OfficeIMO.Html/Rendering/HtmlRenderSurface.cs#L21)

Retained backend-neutral page and display list.

`public HtmlRenderSurfaceResult Descriptor { get; }` [#](#property-descriptor)

[HtmlRenderSurface.cs:23](https://github.com/EvotecIT/OfficeIMO/blob/3b680b1b6fb15a268ff5525a4ca6cdd70b2f6613/OfficeIMO.Html/Rendering/HtmlRenderSurface.cs#L23)

Output geometry, clipping, and source-placement descriptor.

`public HtmlRenderRectangle Bounds { get; }` [#](#property-bounds)

[HtmlRenderSurface.cs:25](https://github.com/EvotecIT/OfficeIMO/blob/3b680b1b6fb15a268ff5525a4ca6cdd70b2f6613/OfficeIMO.Html/Rendering/HtmlRenderSurface.cs#L25)

Complete output-surface rectangle.

`public double RequestedScale { get; }` [#](#property-requestedscale)

[HtmlRenderSurface.cs:27](https://github.com/EvotecIT/OfficeIMO/blob/3b680b1b6fb15a268ff5525a4ca6cdd70b2f6613/OfficeIMO.Html/Rendering/HtmlRenderSurface.cs#L27)

Requested output scale before bounded encoder reduction.

`public OfficeColor BackgroundColor { get; }` [#](#property-backgroundcolor)

[HtmlRenderSurface.cs:29](https://github.com/EvotecIT/OfficeIMO/blob/3b680b1b6fb15a268ff5525a4ca6cdd70b2f6613/OfficeIMO.Html/Rendering/HtmlRenderSurface.cs#L29)

Requested preview and image background.

<!-- PowerForge markdown artifact sha256:CD80299FB034ED2D840A628A0727226F195178502DB0EC1DAF8CD86543BFC72F -->
