# paintScene Function

> paintScene function in the browser TypeScript API: Paints a PageScene onto a CanvasRenderingContext2D with optional images, with a TypeScript example.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Function
- **Path:** TX Sheet Control > API Reference > TypeScript API > Browser Editor > paintScene Function
- **448 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/paintscene-function/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/paintscene-function/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/paintscene-function/llms-full.txt

---

Public function for paintScene.

Package: `@txtextcontrol/tx-sheet-control`. Version: **2.0.0**.

ES module import: `import { paintScene } from '@txtextcontrol/tx-sheet-control';`.

### Syntax

```typescript
paintScene(drawingContext: CanvasRenderingContext2D, scene: PageScene, images?: Map<string, CanvasImageSource>): void
```

### Parameters

| Parameter | Type | Optional | Description |
|---|---|---|---|
| `drawingContext` | `CanvasRenderingContext2D` | No | Value matching drawingContext's declared type and the owning object's validation rules. |
| `scene` | `PageScene` | No | Value matching scene's declared type and the owning object's validation rules. |
| `images` | `Map<string, CanvasImageSource> \| undefined` | Yes | Value matching images's declared type and the owning object's validation rules. |

### Return Value

`void`.

### Examples

Use this public value with the application package shown below. File and font inputs are application-owned resources, not automatically downloaded product data.

```typescript
import { paintScene } from '@txtextcontrol/tx-sheet-control';

function usePaintScene(drawingContext: CanvasRenderingContext2D) {
    const result = paintScene(drawingContext, { width: 640, height: 360, number: 2, commands: [] });
    console.log(result);
}
```

### See Also

- [TypeScript Browser Editor API](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/llms-full.txt)
- [Workbooks and Worksheets](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/workbooks/llms-full.txt)

---

## Nearby

- **Previous:** [PageSetupPatch.showHeadings Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/pagesetuppatch/showheadings-property/llms-full.txt)
- **Next:** [parseAddress Function](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/parseaddress-function/llms-full.txt)
