Draws a shape onto the Canvas.

 

   
Syntax
 
     

[VBScript]
outRect = Canvas.DrawShape(inShape, inParams)

 

   
Params
 
     
Name   Type   Description
inShape String A string indicating the shape to be drawn (see below).
inParams String A parameter string containing Override parameters, Positioning parameters, Transform parameters and Shape Manipulation parameters.
outRect See Desc.

The Rect (before transformation) of the area drawn to.

Under ASP the return value is a comma delimited string.

 

   
Notes
 
     

Allows you to draw a shape onto the Canvas. The following shapes are available.

  • "rectangle" or "rect"
  • "line"
  • "polygon" or "poly" (this is a closed object)
  • "roundrectangle" or "roundrect"
  • "oval"

Rectangles, round rectangles and ovals are drawn to fill the rectangle supplied in the Parameter String.

Lines and polygons require a Points parameter to be supplied to specify where the corners of the shape are.

Lines which are filled become polygons (i.e. the end points are joined).

 

   
See Also
 
     

Canvas DrawData function.

 

   
Example
 
     

[VBScript]
Set mycanvas = Server.CreateObject("ImageGlue7.Canvas")
inpath = Server.MapPath("layers.psd")
outpath = Server.MapPath("drawshape.jpg")
mycanvas.PaintColor = "blue"
mycanvas.PenSize = 4
mycanvas.Width = 250
mycanvas.Height = 250
mycanvas.DrawShape "oval", "Pos=10,10 Size=100,100 Operation=both"
mycanvas.DrawShape "line", "Points=120,120,200,170,130,200 Operation=draw OpenGL=true"
mycanvas.DrawShape "roundrect", "Pos=20,120 Size=80,80 Operation=draw OpenGL=true"
mycanvas.DrawShape "poly", "Points=120,20,200,40,120,100 Operation=draw"
mycanvas.DrawShape "oval", "Pos=0,0 Size=250,250 Operation=draw OpenGL=true"
mycanvas.DrawShape "rect", "Pos=0,0 Size=250,250 Operation=draw"
mycanvas.SaveAs outpath, "Quality=high"

The code draws a number of shapes using a number of different options. Note that the top two shapes are drawn without OpenGL and the bottom two with it.

drawshapes.jpg