Return to index

image functions

svg_circle(handle,x,y,radius[,attributes])

top

Draws a circle on the canvas handle.


svg_def(handle)

top

Attach a definition to the canvas handle.


svg_def_end(handle)

top

Ends a definition in handle.


svg_desc(handle,description)

top

Attach a description to the canvas handle.


svg_ellipse(handle,x,y,w,h[,attributes])

top

Draws an ellipse on the canvas handle.


svg_end(handle)

top

Signals completion of the SVG canvas handle.


svg_grid(handle,x,y,w,h,n[,attributes])

top

Draws a grid on the canvas handle.


svg_group(handle[,attributes])

top

Attach a group definition to the canvas handle.


svg_group_end(handle)

top

Ends a group definition in handle.


svg_image(handle,x,y,w,h,image_link[,attributes])

top

Links an image to the SVG canvas handle.


svg_line(handle,x,y,w,h[,attributes])

top

Draws a line on the canvas handle.


svg_link(handle,href,title)

top

Places a link on the canvas handle.


svg_link_end(handle)

top

Ends a link definition in handle.


svg_plot(handle,x,y[,attributes])

top

Plots a point on the canvas handle.


svg_polygon(handle,[]x,[]y[,attributes])

top

Draws a polygon on the canvas handle.


svg_polyline(handle,[]x,[]y[,attributes])

top

Draws a polyline on the canvas handle.


svg_rect(handle,x,y,w,h[,attributes])

top

Draws a rectangle on the canvas handle.


svg_roundrect(handle,x,y,w,h,rx,ry[,attributes])

top

Draws a rounded rectangle on the canvas handle.


svg_square(handle,x,y,size[,attributes])

top

Draws a square on the canvas handle.


svg_handle = svg_start(filename,w,h[,attributes])

top

Returns a handle to a new SVG canvas. You must use this call to initiate the image creation process.

Returns an empty string on failure or a handle name on success.

Example:

gridstyle           = `stroke:yellow;`

# create an image file
h=svg_start("/tmp/example.svg",500,500)
on h==nil do exit 1, "Invalid handle."

# content
h.svg_title("svg demo")
h.svg_desc("description goes here")
h.svg_grid(100,100,400,400,10,gridstyle)

# write file to disk
h.svg_end


svg_text(handle,x,y,text[,attributes])

top

Writes text to the SVG canvas handle.


svg_title(handle,title)

top

Places a title on the canvas handle.