# Interface: HTMLSourceCanvas

**`Experimental`** **`Advanced`**

An [HTMLCanvasElement](https://developer.mozilla.org/docs/Web/API/HTMLCanvasElement) extended with the experimental HTML-in-Canvas proposal APIs.

These members only exist in browsers that have the HTML-in-Canvas feature enabled, so they
are optional. [HTMLSource](rendering.HTMLSource.html.md) feature-detects `requestPaint`; the HTML-in-Canvas API must
be enabled for the texture to upload.

## Example

```ts
import type { HTMLSourceCanvas } from 'pixi.js/html-source';

const canvas = app.canvas as HTMLSourceCanvas;

// Feature-detect before relying on the experimental API.
if (canvas.requestPaint)
{
    canvas.requestPaint();
}
```

## See

 - [HTMLSource](rendering.HTMLSource.html.md) For the texture source that drives these APIs
 - [ElementImage](rendering.ElementImage.html.md) For the snapshot type `captureElementImage()` returns

## Extends

- [`HTMLCanvasElement`](https://developer.mozilla.org/docs/Web/API/HTMLCanvasElement)

## Properties

### captureElementImage()?

> `optional` **captureElementImage**: (`element`) => [`ElementImage`](rendering.ElementImage.html.md)

**`Experimental`**

Captures the current rendered pixels of `element` into an immutable [ElementImage](rendering.ElementImage.html.md).

#### Parameters

##### element

[`Element`](https://developer.mozilla.org/docs/Web/API/Element)

#### Returns

[`ElementImage`](rendering.ElementImage.html.md)

***

### requestPaint()?

> `optional` **requestPaint**: () => `void`

**`Experimental`**

Requests a `paint` event so the canvas re-snapshots its `layoutsubtree` children.

#### Returns

`void`
