' Add a text and set (update) a text
GraphicsWindow.Title = title + " - AddText()"
txt = "Hello,"
GraphicsWindow.BrushColor = "DimGray"
shp["txt"] = Shapes.AddText(txt)
Shapes.Move(shp["txt"], 310, 310)
Program.Delay(2000)
txt = "World!"
Shapes.SetText(shp["txt"], txt)
' Get the left coodinate
GraphicsWindow.Title = title + " - GetLeft()"
x = Shapes.GetLeft(shp["rect"])
' Get the top coodinate
GraphicsWindow.Title = title + " - GetTop()"
y = Shapes.GetTop(shp["rect"])
' Animate (move) the rectangle
GraphicsWindow.Title = title + " - Animate()"
duration = 3000
x = x + 100
y = y - 100
Shapes.Animate(shp["rect"], x, y, duration)
Program.Delay(3000)
' Move the triangle
GraphicsWindow.Title = title + " - Move()"
x = x + 100
Shapes.Move(shp["tri"], x, y)
Program.Delay(500)
' Rotate the line
GraphicsWindow.Title = title + " - Rotate()"
For angle = 0 To 270
Shapes.Rotate(shp["line"], angle)
Program.Delay(10)
EndFor
' Zoom the image
GraphicsWindow.Title = title + " - Zoom()"
scaleX = 1
For scaleY = 1 To 0.1 Step - 0.05
Shapes.Zoom(shp["img"], scaleX, scaleY)
scaleX = scaleX + 1
Program.Delay(300)
EndFor
' Get opacity and set opacity of the rectangle
GraphicsWindow.Title = title + " - GetOpacity()/SetOpacity()"
For i = 1 To 5
op = Shapes.GetOpacity(shp["rect"])
op = op - 10
Shapes.SetOpacity(shp["rect"], op)
Program.Delay(1000)
EndFor
' Hide and show the ellipse
GraphicsWindow.Title = title + " - HideShape()/ShowShape()"
Shapes.HideShape(shp["ell"])
Program.Delay(1000)
Shapes.ShowShape(shp["ell"])
' Remove all shapes
GraphicsWindow.Title = title + " - Remove()"
n = Array.GetItemCount(shp)
index = Array.GetAllIndices(shp)
For i = 1 To n
Program.Delay(1000)
Shapes.Remove(shp[index[i]])
EndFor
GraphicsWindow.Title = title
Program.Delay(2000)
EndWhile
Sub Init
gw = 598
gh = 428
GraphicsWindow.Width = gw
GraphicsWindow.Height = gh
title = "Sample for Shapes Object"
GraphicsWindow.Title = title
GraphicsWindow.PenWidth = 4
GraphicsWindow.PenColor = "Black"
GraphicsWindow.FontSize = 30
GraphicsWindow.FontName = "Trebuchet MS"
EndSub