Functions

Drawing Objects

SetPixel(DrawXtra member, integer x, integer y) - draws a pixel on the canvas at the specified location.
Example: Redraw(member "canvas")

GetPixel(DrawXtra member, integer x, integer y) - gets the RGB value of a pixel at the specified location, returning a "packed" color. The return value will be -1 if the specified point is not in the canvas.
Example: GetPixel(member "canvas", 10, 10)

DrawLine(DrawXtra member, startX, startY, endX, endY) - draws a line from one point to another.
Example: DrawLine(member "canvas", 10, 10, 100, 50)

DrawSingleArrow(DrawXtra member, startX, startY, endX, endY) - draws a line from one point to another, with an arrowhead attached to the end of the line.
Example: DrawSingleArrow(member "canvas", 10, 10, 100, 50)

DrawDoubleArrow(DrawXtra member, startX, startY, endX, endY) - draws a line from one point to another, with arrowheads attached to both ends of the line.
Example: DrawSingleArrow(member "canvas", 10, 10, 100, 50)

DrawVector(DrawXtra member, startX, startY, integer angle, integer magnitude) - draws a 2D vector using the angle & magnitude (length) of the line to determine the endpoint.
Example: DrawVector(member "canvas", 10, 10, 135, 20)

Fill(DrawXtra member, integer x, integer y) - performs a paint bucket fill at the specified point.
Example: Fill(member "canvas", 20, 30)

DrawFramedRectangle(DrawXtra member, left, top, right, bottom) - draws a framed rectangle.
Example: DrawFramedRectangle(member "canvas", 20, 30, 100, 100)

DrawFilledRectangle(DrawXtra member, left, top, right, bottom) - draws a filled rectangle.
Example: DrawFilledRectangle(member "canvas", 20, 30, 100, 100)

DrawFramedSquare(DrawXtra member, left, top, edgeSize) - draws a framed square.
Example: DrawFramedSquare(member "canvas", 20, 20, 100)

DrawFilledSquare(DrawXtra member, left, top, edgeSize) - draws a filled square.
Example: DrawFilledSquare(member "canvas", 20, 20, 100)

DrawFramedEllipse(DrawXtra member, left, top, right, bottom) - draws a framed ellipse.
Example: DrawFramedEllipse(member "canvas", 20, 30, 100, 100)

DrawFilledEllipse(DrawXtra member, left, top, right, bottom) - draws a filled ellipse.
Example: DrawFilledEllipse(member "canvas", 20, 30, 100, 100)

DrawFramedCircle(DrawXtra member, left, top, diameter) - draws a framed circle.
Example: DrawFramedCircle(member "canvas", 50, 50, 100)

DrawFilledCircle(DrawXtra member, left, top, diameter) - draws a filled circle.
Example: DrawFilledCircle(member "canvas", 50, 50, 100)

DrawText(DrawXtra member, integer x, integer y, string text) - draws text, at coordinates (x,y), using the current canvasFont and canvasFontSize.
Example: DrawText(member "canvas", 50, 50, "Text to be printed")

DrawArc(DrawXtra member, left, top, right, bottom, x1, y1, x2, y2) - draws an arc bounded by the rectangle defined by the left, top, right and bottom points. Point (x1,y1) defines the starting point of the arc and (x2,y2) defines the end point of the arc.
Example: DrawArc(member "canvas", 0, 0, 200, 200, 0, 100, 150, 200)

DrawFramedRoundRect(DrawXtra member, left, top, right, bottom) - draws a framed rectangle with rounded corners. The amount of rounding on the corners is defined by the current roundedRectCornerWidth and roundedRectCornerHeight properties.
Example: DrawFramedRoundRect(member "canvas", 0, 0, 200, 200)

DrawFilledRoundRect(DrawXtra member, left, top, right, bottom) - draws a filled rectangle with rounded corners. The amount of rounding on the corners is defined by the current roundedRectCornerWidth and roundedRectCornerHeight properties.
Example: DrawFilledRoundRect(member "canvas", 0, 0, 200, 200)
Getting Started Packed Colors Properties Creating Projectors Using the Xtra in Shockwave Known Issues How to Order and Register Licensing and Availability Technical Support