Circle.sel
#!./Selene
Selene.UseDRMCairo()
card,err,msg = SelDCCard.Open()
if not card then
print("*E*", err,msg)
os.exit()
end
local srf = card:GetPrimarySurface()
local w,h = srf:GetSize() srf:Clear( 0,0,0 )
local r = w/3
if h < w then
r = h/3
end
math.randomseed( os.time() )
srf:SetColor( 1, 0.5, 0.5 )
srf:DrawArc( w/2, h/2, r, 0, 2*math.pi )
srf:SetColor( 0, 0, 1 )
srf:DrawArc( w/2, h/2, r+05, 0, math.pi/2 ) srf:SetColor( 0, 1, 0 )
srf:DrawArc( w/2, h/2, r+10, math.pi/2, math.pi ) srf:SetColor( 0, 1, 1 )
srf:DrawArc( w/2, h/2, r+15, math.pi, 3*math.pi/2 ) srf:SetColor( 1, 0, 0 )
srf:DrawArc( w/2, h/2, r+20, 3*math.pi/2, 2*math.pi )
srf:FillArc( w/2, h/2, r-15, 0, math.pi/2 )
srf:SetColor( 1, 1, 0, 0.5 )
srf:FillArc( w/2, h/2, r-15, math.random()*2*math.pi, math.random()*2*math.pi )
fch,err,msg = srf:Dump("/tmp","Gfx")
if not fch then print("Can't dump", err, msg);
else
print("Dumped to", fch);
end
print "Hit 'enter' key to exit"
io.stdin:read'*l'
srf:Release()
card:Release()