# Pictures and Shapes

> Insert pictures and shapes with DrawingCollection, group them, add shadows and rotation in Format Shape or Format Picture and format rich text within cells.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Topic
- **Path:** TX Sheet Control > Spreadsheet Documents > Pictures and Shapes
- **1591 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/spreadsheets/pictures-shapes/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/spreadsheets/pictures-shapes/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/spreadsheets/pictures-shapes/llms-full.txt

---

Pictures and shapes sit above the cells of a worksheet as drawings. The drawing collection of each worksheet manages its embedded pictures, shapes and groups, and every object has a document identity, an anchor, dimensions and formatting. Rich content also includes text inside a cell whose runs carry their own emphasis and colors.

Dashboard widgets are separate objects. In version 2.0, they do not include an Image widget.

### How Drawings Are Placed

[Worksheet.drawings](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/worksheet/drawings-property/llms-full.txt) returns the [DrawingCollection](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/drawingcollection/llms-full.txt) of a worksheet, the worksheet drawing collection that inserts, finds, groups and removes its drawings.

- **Anchors.** An [Anchor](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/anchor/llms-full.txt) refers to a worksheet cell, with optional offsets in CSS pixels.
- **Geometry.** Screen zoom does not alter the unscaled geometry.
- **Snapshots.** The snapshot of a drawing, [DrawingHandle.snapshot](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/drawinghandle/snapshot-property/llms-full.txt), is detached. Modify a drawing through the update methods of its handle, such as [DrawingHandle.update](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/drawinghandle/update-method/llms-full.txt), rather than editing a returned object and expecting a live change.

### Insert Pictures

[DrawingCollection.addPicture](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/drawingcollection/addpicture-method/llms-full.txt) inserts an embedded picture above the cells. Use a supported [PictureSource](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/picturesource/llms-full.txt): bytes, a data URL or base64 with a MIME type, as appropriate. Provide:

- one source representation
- meaningful alternative text
- a worksheet anchor
- unscaled dimensions

Upload validation, network retrieval and authorization belong to the application.

> Important
>
> **Picture URLs.** Do not assume that a URL is fetched automatically wherever a picture source is accepted. Retrieve and validate the bytes in the host, and pass an accepted source.

Check the supported image types and rendering limits with your actual document workflow.

### Add Shapes and Groups

[DrawingCollection.addShape](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/drawingcollection/addshape-method/llms-full.txt) inserts a shape. Shape options, described by [ShapeOptions](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/shapeoptions/llms-full.txt), control the geometry, text, fill, outline, effects, rotation and placement where supported. Use the exported shape types in [SHAPE\_TYPES](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/shape-types-constant/llms-full.txt) and the drawing reference.

[DrawingCollection.group](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/drawingcollection/group-method/llms-full.txt) groups drawings of the same worksheet into a [DrawingGroup](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/drawinggroup/llms-full.txt). Grouping supports the common move and size operations. Copying a member can apply to the group according to the documented operation: [DrawingHandle.copyTo](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/drawinghandle/copyto-method/llms-full.txt) copies the entire group when the drawing is grouped.

### Format a Drawing in the Editor

Select the drawing and open **Format Shape** or **Format Picture**. Both dialogs use the shared icon header, fixed settings workspace, live preview and **Cancel** / **OK** footer. Changes remain a draft until **OK**. On desktop, the settings scroll separately from the preview; on narrow screens, the preview follows the settings.

**Format Shape** provides **Size and Properties**, **Fill**, **Outline**, **Effects** and **Text** sections. Opening one closes the previous section. Related controls stay in place and become disabled when their option is off, so enabling a gradient, shadow or text option does not shift the remaining settings.

![Format Shape with gradient fill controls and a live preview of a sales-report callout](https://docs.textcontrol.com/assets/img/tx-sheet-control/format-shape.09bf5520.webp)

**Format Picture** provides **Size and Properties** for the name, alternative text, dimensions, rotation and flipping. Supply alternative text that describes the purpose of the picture in the report.

![Format Picture with size, rotation, flipping and alternative-text controls beside its preview](https://docs.textcontrol.com/assets/img/tx-sheet-control/format-picture.02dde58d.webp)

### Add a Shadow and Rotate a Shape

Select a shape and choose **Shape Effects** → **Shadow** to add a shadow, or **Glow** to add a glow. The editor previews the effect as you rotate the shape with its rotation handle. Releasing the handle commits the rotation as one editing action, which you can undo. These effects are also retained when saving the workbook or exporting a PDF.

With an initialized browser editor named `editor`, add a sales callout and apply a shadow through [DrawingHandle.update](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/drawinghandle/update-method/llms-full.txt). Dimensions, blur and distance are in unscaled CSS pixels; [DrawingHandle.rotate](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/drawinghandle/rotate-method/llms-full.txt) takes the absolute angle in degrees.

```javascript
await editor.ready;
const sheet = editor.workbook.sheets.at(0);
const callout = sheet.drawings.addShape({
    type: 'roundRect',
    name: 'Quarterly Sales',
    anchor: { cell: 'E4' },
    size: { width: 260, height: 110 },
    text: 'Quarterly sales: $125,000',
    fill: '#e7f1ff'
});

callout.update({
    shadow: {
        color: '#000000',
        opacity: 0.3,
        blur: 8,
        distance: 8,
        angle: 45
    }
});
callout.rotate(15);
```

The code inserts a callout anchored to E4, adds a translucent shadow and turns the shape to 15 degrees. Its shadow settings remain editable after the rotation. To remove the shadow, pass `{ shadow: null }` to `update`.

### Format Rich Cell Text

The text runs of a cell, each a [CellTextRun](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/celltextrun/llms-full.txt), can carry independent emphasis and colors. Preserve the relationship between text and runs during edits, and choose fonts that contain the required glyphs. Wrapping, alignment, rotation and column width all affect the final layout.

### Review Imports and Exports

Review imported drawings and exported PDFs, particularly for effects or foreign formats outside the editable feature set.

### Next Steps

- [Formatting and Number Display](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/formatting/llms-full.txt): format cells, styles and rich text.
- [Charts and Sparklines](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/charts/llms-full.txt): add charts that visualize the data of a worksheet.
- [Tagged PDF and Accessibility](https://docs.textcontrol.com/tx-sheet-control/pdf/accessibility/llms-full.txt): give pictures alternative text and export accessible PDF.

---

## Nearby

- **Previous:** [Charts and Sparklines](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/charts/llms-full.txt)
- **Next:** [Comments, Notes and Hyperlinks](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/comments/llms-full.txt)
