# DrawingCollection.addPicture Method

> DrawingCollection.addPicture method in the TX Sheet Control TypeScript API for the browser: Insert an embedded picture above cells.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Method
- **Path:** TX Sheet Control > API Reference > TypeScript API > Browser Editor > DrawingCollection > DrawingCollection.addPicture Method
- **484 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/drawingcollection/addpicture-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/drawingcollection/addpicture-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/drawingcollection/addpicture-method/llms-full.txt

---

Insert an embedded picture above cells.

Owner: [DrawingCollection](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/drawingcollection/llms-full.txt). Package: `@txtextcontrol/tx-sheet-control`. Version: **2.0.0**.

### Syntax

```typescript
addPicture(options: DrawingOptions & { source: PictureSource | string; }): Drawing
```

### Parameters

| Parameter | Type | Optional | Description |
|---|---|---|---|
| `options` | `DrawingOptions & { source: PictureSource \| string; }` | No | Optional settings validated before the operation is applied. |

### Return Value

`Drawing`.

A detached result or a handle bound to the same worksheet.

### Examples

This example embeds a tiny PNG. Replace its data URL with your own supported image content.

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

function addSamplePicture(book: Workbook) {
    const sheet = book.sheets.at(0);
    sheet.drawings.addPicture({
        source: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+jRZkAAAAASUVORK5CYII=',
        anchor: { cell: 'F2' },
        size: { width: 32, height: 32 },
    });
}
```

### Remarks

Use this member on an object from the current document. Reacquire document-bound handles after replacement/deletion. Validate arguments against the declared types and documented bounds; handle exceptions or rejected promises.

### See Also

- [DrawingCollection Class](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/drawingcollection/llms-full.txt)
- [Pictures and Shapes](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/pictures-shapes/llms-full.txt)
- [PictureSource Interface](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/picturesource/llms-full.txt)
- [DrawingOptions Interface](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/drawingoptions/llms-full.txt)

---

## Nearby

- **Previous:** [DrawingCollection Class](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/drawingcollection/llms-full.txt)
- **Next:** [DrawingCollection.addShape Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/drawingcollection/addshape-method/llms-full.txt)
