canvas-retina

1.0.3 • Public • Published

canvas-retina

you can see the HD canvas

use for

source1 --> source2-->

examples

// html
<canvas id="canvas"></canvas>
// npm install canvas-retina
import canvasRetina from 'canvas-retina'

const {
  pixelRatio, // value of devicePixelRatio / backingStore, if you need this
  ctx, // object of canvas dom getContext('2d'), if you need this
  rect // object of canvas dom getBoundingClientRect(), if you need this
} = canvasRetina(document.getElementById('canvas'))

// or
<script src="https://github.com/nicoleffect/canvas-retina/dist/canvas-retina.iife.min.js"></script>

canvasRetina(document.getElementById('canvas'))

all modes

amd、cjs、es、iife、umd

Package Sidebar

Install

npm i canvas-retina

Weekly Downloads

4

Version

1.0.3

License

MIT

Unpacked Size

3.26 kB

Total Files

4

Last publish

Collaborators

  • nicole.wong