Get started with qartjs CDN

GPL-3.0 licensed

QartJS is a lightweight library for creating and manipulating SVG graphics.

Tags:
  • qart
  • qr
  • qrcode

Stable version

Copied!

How to start using qartjs CDN


<!DOCTYPE html>
<html>
<head>
    <title>Get started with qartjs CDN - cdnhub.io</title>
    <script src="https://cdn.cdnhub.io/qartjs/1.2.0/qart.min.js"></script>
</head>
<body>
    <div id="canvas"></div>
    <script>
        const canvas = document.getElementById('canvas');
        const ctx = canvas.getContext('2d');
        canvas.width = 300;
        canvas.height = 300;

        Qart.init(ctx);

        const qart = new Qart();
        qart.load('https://cdn.cdnhub.io/qartjs/examples/images/lena.png')
            .then((image) => {
                const width = image.width;
                const height = image.height;

                const x = canvas.width / 2 - width / 2;
                const y = canvas.height / 2 - height / 2;

                qart.drawImage(image, x, y, width, height);
                qart.render();
            });
    </script>
</body>
</html>
Copied!
Copied!
Copied!
Copied!

All versions