Summary

   



 Download CD Content

Overview

This chapter demonstrates how to use the SVG elements circle, ellipse, and path in order to render circles, ellipses and elliptic arcs, respectively. Unlike other languages such as Java, SVG provides a separate SVG circle element for specifying a circle, even though circles are actually a special case of ellipses, which means that you could use the SVG ellipse element to specify a circle. You'll see how these SVG elements can be combined with linear color gradients and radial color gradients to create richer graphics images.

Unfortunately, rendering elliptic arcs in SVG is not nearly as straightforward or intuitive as in other languages such as Java. You may already know that Java uses intuitive drawArc and fillArc methods for rendering elliptic arcs, whereas SVG uses a path element in order to render elliptic arcs. On the other hand, the SVG path element is an extremely powerful construct that can be used for rendering Bezier curves in addition to elliptic arcs. This chapter contains examples that will give you a feel for the versatility of the SVG path element.

We will also explore techniques for defining radial color gradients that can be used for creating three-dimensional effects. These techniques are based on the manner in which you specify the stop-color/offset combinations. In particular, you'll see radial color gradients combined with circles in order to create pseudo spheres. All code and images for this chapter can be found on the companion CD-ROM in the Chapter 3 folder.



   



Fundamentals of SVG Programming. Concepts to Source Code
Fundamentals of SVG Programming: Concepts to Source Code (Graphics Series)
ISBN: 1584502983
EAN: 2147483647
Year: 2003
Pages: 362

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