drawingSvgCompile | ||||||||||
Type | function | |||||||||
Dictionary | library.drawing | |||||||||
Library | Drawing Library | |||||||||
Syntax |
| |||||||||
Associations | com.livecode.library.drawing | |||||||||
Summary | Compile an SVG XML file to a drawing metafile. | |||||||||
Platforms | desktop, mobile | |||||||||
Parameters |
| |||||||||
Example |
| |||||||||
Values |
| |||||||||
Related | Function: drawingSvgCompileFile | |||||||||
Description | Use drawingSvgCompile to build a binary string representing an SVG file which can be used as the 'text' of an image object for display. The text of the SVG XML document is parsed using revXML and then stripped of all attributes and elements not currently understood by the SVG compiler. The resulting SVG is then converted to a lower-level form and encoded. This form can be used as the text of an image. The following SVG features are currently supported:
Color values of the following forms are supported:
Radial gradients support focal point (fx, fy) and SVG2's focal radius (fr). The rendering of an SVG file inside an image object respects the width, height, viewBox and preserveAspectRatio attributes on the root SVG node in the document. If the width and height attributes are specified, and they are not percentages, then they are taken to be the formattedWidth/Height of the image object. In this case the SVG will always display at that fixed size, clipped to the rect of the image. If the width and height attributes are not specified, or are percentages, and a viewBox attribute is specified then the width and height of the viewBox are taken to be the formattedWidth/Height of the image object. In this case the SVG will scale to fit within the rect of the image object, respecting the setting of the SVG's preserveAspectRatio attribute. Finally if the width and height are not specified, or are percentages and there is no viewBox attribute then the intrinsic width and height are taken to be 256.
|