canvas-retina
v1.0.3
Published
you can see the HD canvas
Downloads
11
Maintainers
Readme
canvas-retina
you can see the HD canvas
use for
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