Max API  8.0.2
Scalable Vector Graphics

Functions

t_jsvgjsvg_create_from_file (const char *filename, short path)
 Read an SVG file, return a t_jsvg object. More...
 
t_jsvgjsvg_create_from_resource (const void *moduleRef, const char *resname)
 Read an SVG file from a resource. More...
 
t_jsvgjsvg_create_from_xmlstring (const char *svgXML)
 Create an SVG object from a string containing the SVG's XML. More...
 
void jsvg_get_size (t_jsvg *svg, double *width, double *height)
 Retrieve the size of an SVG object. More...
 
void jsvg_destroy (t_jsvg *svg)
 Free a t_jsvg object. More...
 
void jsvg_render (t_jsvg *svg, t_jgraphics *g)
 Render an SVG into a graphics context. More...
 

Detailed Description

Function Documentation

◆ jsvg_create_from_file()

t_jsvg* jsvg_create_from_file ( const char *  filename,
short  path 
)

Read an SVG file, return a t_jsvg object.

Parameters
filenameThe name of the file to read.
pathThe path id of the file to read.
Returns
A new SVG object.

◆ jsvg_create_from_resource()

t_jsvg* jsvg_create_from_resource ( const void *  moduleRef,
const char *  resname 
)

Read an SVG file from a resource.

Parameters
moduleRefThe external's moduleRef.
resnameThe name of the SVG resource.
Returns
A new SVG object.
See also
jgraphics_image_surface_create_from_resource()

◆ jsvg_create_from_xmlstring()

t_jsvg* jsvg_create_from_xmlstring ( const char *  svgXML)

Create an SVG object from a string containing the SVG's XML.

Parameters
svgXMLThe SVG source.
Returns
A new SVG object.

◆ jsvg_destroy()

void jsvg_destroy ( t_jsvg svg)

Free a t_jsvg object.

Parameters
svgThe object to free.

◆ jsvg_get_size()

void jsvg_get_size ( t_jsvg svg,
double *  width,
double *  height 
)

Retrieve the size of an SVG object.

Parameters
svgAn SVG object.
widthThe address of a variable that will be set to the width upon return.
heightThe address of a variable that will be set to the width upon return.

◆ jsvg_render()

void jsvg_render ( t_jsvg svg,
t_jgraphics g 
)

Render an SVG into a graphics context.

Parameters
svgThe SVG object to render.
gThe graphics context in which to render.