Return to index

image functions

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

top

Draws a circle on the canvas handle.

Example:

# Example for svg_circle
h = svg_start("test.svg", 100, 100)
svg_circle(h, 50, 50, 20)
svg_end(h)


svg_def(handle)

top

Attach a definition to the canvas handle.

Example:

# Example for svg_def
h = svg_start("test.svg", 100, 100)
svg_def(h)
svg_def_end(h)
svg_end(h)


svg_def_end(handle)

top

Ends a definition in handle.

Example:

# Example for svg_def_end
h = svg_start("test.svg", 100, 100)
svg_def(h)
svg_def_end(h)
svg_end(h)


svg_desc(handle,description)

top

Attach a description to the canvas handle.

Example:

# Example for svg_desc
h = svg_start("test.svg", 100, 100)
svg_desc(h, "Test SVG")
svg_end(h)


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

top

Draws an ellipse on the canvas handle.

Example:

# Example for svg_ellipse
h = svg_start("test.svg", 100, 100)
svg_ellipse(h, 50, 50, 30, 20)
svg_end(h)


svg_end(handle)

top

Signals completion of the SVG canvas handle.

Example:

# Example for svg_end
h = svg_start("test.svg", 100, 100)
svg_end(h)


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

top

Draws a grid on the canvas handle.

Example:

# Example for svg_grid
h = svg_start("test.svg", 100, 100)
svg_grid(h, 10, 10, 0, 0, 100)
svg_end(h)


svg_group(handle[,attributes])

top

Attach a group definition to the canvas handle.

Example:

# Example for svg_group
h = svg_start("test.svg", 100, 100)
svg_group(h)
svg_group_end(h)
svg_end(h)


svg_group_end(handle)

top

Ends a group definition in handle.

Example:

# Example for svg_group_end
h = svg_start("test.svg", 100, 100)
svg_group(h)
svg_group_end(h)
svg_end(h)


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

top

Links an image to the SVG canvas handle.

Example:

# Example for svg_image
h = svg_start("test.svg", 100, 100)
svg_image(h, 0, 0, 50, 50, "test.png")
svg_end(h)


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

top

Draws a line on the canvas handle.

Example:

# Example for svg_line
h = svg_start("test.svg", 100, 100)
svg_line(h, 0, 0, 100, 100)
svg_end(h)


svg_link(handle,href,title)

top

Places a link on the canvas handle.

Example:

# Example for svg_link
h = svg_start("test.svg", 100, 100)
svg_link(h, "https://example.com", "Link")
svg_link_end(h)
svg_end(h)


svg_link_end(handle)

top

Ends a link definition in handle.

Example:

# Example for svg_link_end
h = svg_start("test.svg", 100, 100)
svg_link(h, "https://example.com", "Link")
svg_link_end(h)
svg_end(h)


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

top

Plots a point on the canvas handle.

Example:

# Example for svg_plot
h = svg_start("test.svg", 100, 100)
svg_plot(h, 50, 50)
svg_end(h)


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

top

Draws a polygon on the canvas handle.

Example:

# Example for svg_polygon
h = svg_start("test.svg", 100, 100)
svg_polygon(h, to_typed([0, 50, 100], "[]int"), to_typed([0, 100, 0], "[]int"))
svg_end(h)


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

top

Draws a polyline on the canvas handle.

Example:

# Example for svg_polyline
h = svg_start("test.svg", 100, 100)
svg_polyline(h, to_typed([0, 50, 100], "[]int"), to_typed([0, 50, 100], "[]int"))
svg_end(h)


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

top

Draws a rectangle on the canvas handle.

Example:

# Example for svg_rect
h = svg_start("test.svg", 100, 100)
svg_rect(h, 10, 10, 80, 80)
svg_end(h)


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

top

Draws a rounded rectangle on the canvas handle.

Example:

# Example for svg_roundrect
h = svg_start("test.svg", 100, 100)
svg_roundrect(h, 10, 10, 80, 80, 5, 5)
svg_end(h)


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

top

Draws a square on the canvas handle.

Example:

# Example for svg_square
h = svg_start("test.svg", 100, 100)
svg_square(h, 10, 10, 80)
svg_end(h)


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:

# Example for svg_start
h = svg_start("test.svg", 100, 100)
svg_end(h)


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

top

Writes text to the SVG canvas handle.

Example:

# Example for svg_text
h = svg_start("test.svg", 100, 100)
svg_text(h, 50, 50, "Hello")
svg_end(h)


svg_title(handle,title)

top

Places a title on the canvas handle.

Example:

# Example for svg_title
h = svg_start("test.svg", 100, 100)
svg_title(h, "Test")
svg_end(h)