Section 25.23. CanvasRenderingContext2D.fill( ): fill the path


25.23. CanvasRenderingContext2D.fill( ): fill the path

25.23.1. Synopsis

 void fill( ) 

25.23.2. Description

fill( ) fills the current path with the color, gradient, or pattern specified by the fillStyle property. Each subpath of the path is filled independently. Any subpaths that are not closed are filled as if the closePath( ) method had been called on them. (Note, however, that this does not actually cause those subpaths to become closed.)

The canvas uses the "non-zero winding rule" to determine which points are inside the path and which are outside. The details of this rule are beyond the scope of this book, but they typically matter only for complex paths that intersect themselves.

Filling a path does not clear the path. You may call stroke( ) after calling fill( ) without redefining the path.

25.23.3. See Also

CanvasRenderingContext2D.fillRect( )




JavaScript. The Definitive Guide
JavaScript: The Definitive Guide
ISBN: 0596101996
EAN: 2147483647
Year: 2004
Pages: 767

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net