1.0.3 • Published 5 years ago

canvas-retina v1.0.3

Weekly downloads
4
License
MIT
Repository
github
Last release
5 years ago

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