Book Image

Delphi Cookbook

By : Daniele Teti
Book Image

Delphi Cookbook

By: Daniele Teti

Overview of this book

Table of Contents (14 chapters)
Delphi Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Showing complex vector shapes using paths


One of the biggest advantages of FireMonkey compared to VCL is its vector-based nature. Various visual parts can be created in FireMonkey using vector-based graphics (even if in some cases, using a bitmapped approach can be faster). In terms of vectorial graphics, there is a nice language called Scalable Vector Graphics (SVG) that allows you to define primitive shapes using a set of coordinates and not a raster image. So, you can stretch the image without losing its resolution, because the image is not actually stretched, but completely redrawn using the new coordinates. That's it; the SVG file is made up of coordinates and mathematical formulae to join them.

Inside the SVG language, there is an element called SVG path. The path element is used to define a path. So, what's a path?

A path is a sequence of instructions to draw something using primitives. Think of an SVG path as a language into another language (let's say a sort of internal DSL).

The following...