# paintScene Function

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

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Function
- **Path:** TX Sheet Control > API Reference > JavaScript API > Browser Editor > paintScene Function
- **443 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/paintscene-function/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/paintscene-function/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/javascript-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

```javascript
paintScene(drawingContext, scene, images)
```

### 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.

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

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

### See Also

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

---

## Nearby

- **Previous:** [OperationCanceledError.code Property](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/operationcancelederror/code-property/llms-full.txt)
- **Next:** [parseAddress Function](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/parseaddress-function/llms-full.txt)
