# canvas-compose-image

> compose.js

Latest version **0.0.3** (published 2019-02-26) · ISC license · 0 weekly downloads

## Install

```sh
npm install canvas-compose-image
pnpm add canvas-compose-image
yarn add canvas-compose-image
bun add canvas-compose-image
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2019-02-26 |
| First published | 2019-02-26 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 647.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Maintainers | liudehua123 |

## Links

- npm: https://www.npmjs.com/package/canvas-compose-image
- Repository: https://github.com/easterCat/canvas-compose-image
- Homepage: https://github.com/easterCat/canvas-compose-image#readme
- Issues: https://github.com/easterCat/canvas-compose-image/issues
- npm.io page: https://npm.io/package/canvas-compose-image

## Recent versions

- 0.0.3 (latest) — 2019-02-26
- 0.0.2 — 2019-02-26
- 0.0.1 — 2019-02-26

## README

```
npm install canvas-compose-image --save
```

使用

```
<script type="text/javascript">
    window.onload = function() {
      var compose = document.querySelectorAll(".compose");
      var src_arr = [];
      compose.forEach(node => {
        src_arr.push(node.src);
      });

      ComposeCanvas.compose(
        [400, 400],
        [
          {
            src: src_arr[0],
            type: "image",
            mode: "waiting",
            pos: [200, 0, 200, 200]
          },
          {
            src: src_arr[1],
            type: "image",
            mode: "waiting",
            pos: [200, 200, 200, 200]
          },
          {
            src: src_arr[2],
            type: "image",
            mode: "waiting",
            pos: [0, 0, 200, 200]
          },
          {
            src: src_arr[3],
            type: "image",
            mode: "waiting",
            pos: [0, 200, 200, 200]
          },
          {
            text: "我是南帝",
            type: "text",
            mode: "waiting",
            pos: [50, 100],
            style: {
              color: "#333",
              font: "30px serif"
            }
          },
          {
            text: "我是北丐",
            type: "text",
            mode: "waiting",
            pos: [0, 320],
            style: {
              color: "#333",
              font: "40px serif"
            }
          },
          {
            text: "中神通呢？",
            type: "text",
            mode: "waiting",
            pos: [120, 220],
            style: {
              color: "#333",
              font: "40px serif"
            }
          }
        ],
        function(img) {
          console.log(img);
          document.getElementById("hello").appendChild(img);
        }
      );
    };
  </script>
```

---
_Source: https://npm.io/package/canvas-compose-image · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
