New to Kendo UI for jQueryStart a free 30-day trial

FromRect

class methods

Create a straight path from the given rectangle.

Parameters:rectkendo.geometry.Rect

The source rectangle to trace.

Returns:kendo.drawing.Path

The newly constructed path.

<div id="surface" style="width: 250px; height: 250px;"></div>
<script>
    var draw = kendo.drawing;
    var geom = kendo.geometry;

    var rect = new geom.Rect([50, 50], [150, 100]);

    var path = draw.Path.fromRect(rect, {
        stroke: {
            color: "#9b59b6",
            width: 2
        },
        fill: {
            color: "#ecf0f1"
        }
    });

    var surface = draw.Surface.create($("#surface"));
    surface.draw(path);
</script>
Not finding the help you need?
Contact Support