% Program to save a picture in mypic.bmp
var picID: int
var x, y : int
Draw.FillBox (50, 50, 150, 150, red)
Draw.FillStar (50, 50, 150, 150, green)
Draw.FillOval (100, 100, 50, 50, blue)
picID := Pic.New (50, 50, 150, 150)
Pic.Save (picID, "mypic.bmp")
Pic.Free (picID)
% Program to load the picture back again and draw 50 copies
var picID: int
var x, y : int
picID := Pic.FileNew ("mypic.bmp")
for i : 1 .. 50
x := Rand.Int (0, maxx) % Random x
y := Rand.Int (0, maxy) % Random y
Pic.Draw (picID, x, y, picCopy)
end for
Pic.Free (picID) |