New to Kendo UI for jQuery? Download free 30-day trial

Exporting Drawings to Images

The Drawing library supports the export of drawings to bitmap images in a PNG file format.

    <button class="k-button k-primary" onclick="exportImg()">Export Image</button>
    <script>
        var draw = kendo.drawing;
        var geom = kendo.geometry;

        var rect = new geom.Rect([5, 5], [240, 240]);
        var path = draw.Path.fromRect(rect).stroke("red", 5);

        var root = new draw.Group();
        root.append(path);

        function exportImg(){
            draw.exportImage(root, { width: "250px", height: "250px" }).done(function(data) {
                kendo.saveAs({
                    dataURI: data,
                    fileName: "frame.png"
                });
            });
        }
    </script>

See Also

In this article