The rect function

Share RGraph:   To help my Google visibility (it can't get much worse!), if you like and use RGraph I'd appreciate it if you could link to me
[No canvas support]
An example of the rect function

The rect function is used whilst drawing paths to the canvas to draw a rectangle to the canvas. Nothing is actually drawn to the canvas until you call the stroke or fill functions.

Arguments to the function


An example

<script>
    window.onload = function ()
    {
        var canvas  = document.getElementById("cvs");
        var context = canvas.getContext('2d');

        context.beginPath();
        context.rect(50, 50, 100, 100);
        context.stroke();
    }
</script>

Comments

© Copyright Richard Heyes 2008-2017
Terms and conditions   Privacy policy   Sitemap   About