Microsoft Small Basic

Program Listing: GKM721
' Parts of a Robot - Copyright (c) 2014 Nonki Takahashi.
'
path = "http://www.nonkit.com/smallbasic.files/"
scale = 0.5
x = 10
y = 10
part = "Rbody.png"
ShowPart()
part = "Rarm.png"
ShowPart()
part = "Rhand.png"
ShowPart()
part = "Rfoot.png"
ShowPart()
Sub ShowPart
img = ImageList.LoadImage(path + part)
h = ImageList.GetHeightOfImage(img)
w = ImageList.GetWidthOfImage(img)
obj[part] = Shapes.AddImage(img)
Shapes.Zoom(obj[part], scale, scale)
Shapes.Move(obj[part], (x + 140) - (1 - scale) * w / 2, y - (1 - scale) * h / 2)
GraphicsWindow.BrushColor = "Black"
GraphicsWindow.DrawText(x, y, part)
y = y + 20
GraphicsWindow.DrawText(x, y, "width=" + w + " (" + (w * scale) + ")")
y = y + 20
GraphicsWindow.DrawText(x, y, "height=" + h + " (" + (h * scale) + ")")
y = y + 80
EndSub