---
name: "CanvasContext.transform"
mode: "api"
versionRequirements:
  - { name: "Base Library", version: "2.21.8" }
title: "transform"
---

## CanvasContext.transform

> [VERSION] Base Library >= 2.21.8

### Description

Multiply the current transform by a matrix

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `scaleX` | `number` | Yes | Horizontal scaling |
| `skewX` | `number` | Yes | Horizontal skew |
| `skewY` | `number` | Yes | Vertical skew |
| `scaleY` | `number` | Yes | Vertical scaling |
| `translateX` | `number` | Yes | Horizontal translation |
| `translateY` | `number` | Yes | Vertical translation |

### Return Value

None


### Examples

#### Transform using a matrix

```ts
const ctx = ty.createCanvasContext('myCanvas');
ctx.transform(1, 0.5, -0.5, 1, 30, 10);
ctx.fillRect(0, 0, 100, 50);
ctx.draw();
```
