-- a page of 200 mm by 100 mm pl = Graphics.New({{"Canvas.Size.X",200}, {"Canvas.Size.Y",100}}) -- a card of 40 mm by 20 mm: a grey background (a bitmap of one pixel), a bar of 8 colors (a bitmap -- of 8 by 1 pixels), a frame and a text. Bitmaps are drawn below lines and texts, in the order added. Card = Graphics.New({{"Canvas.Size.X",40}, {"Canvas.Size.Y",20}, {"Canvas.Origin.Y",40}}) Card.Add({"BitMap", {0,0}, {1,1}, { {224} }}) Bar = {} for k = 1, 8 do Bar[k] = {32*k-1, 0, 256-32*k} end Card.Add({"BitMap", {0.1,0.1}, {0.9,0.3}, {Bar}}, {{"Pixelated",true}}) Card.Add({ {0,0}, {1,0}, {1,1}, {0,1} }, {{"Close",true}, {"Fill Color",0xFF000000}}) Card.Add("Quanty", 0.5, 0.45, {{"Alignment","c"}, {"Size",0.35}}) -- four copies of the card on the page, each a layer, turned by 0, 30, 60 and 90 degrees about its middle for k = 0, 3 do Card.OriginX = 10 + 47*k pl.Add(Card) pl.Rotate(k*Pi/6, {{"Layer",-1}}) end -- the canvas of a turned layer is the box around the turned card T = Graphics.ToTable(pl) for k = 1, 4 do print(string.format("card %d: %5.2f mm by %5.2f mm", k, T.Layer[k].CanvasSize[1], T.Layer[k].CanvasSize[2])) end -- the function form returns a turned copy: the whole page turned by 90 degrees is a page in portrait Portrait = Graphics.Rotate(pl, Pi/2) print(string.format("page: %5.1f mm by %5.1f mm", pl.SizeX, pl.SizeY)) print(string.format("turned: %5.1f mm by %5.1f mm", Portrait.SizeX, Portrait.SizeY)) file = io.open("Rotate.svg", "w") file:write(Graphics.ToSVG(pl, {{"RelativeSize",true}})) file:close()