Rectangle.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)
srf:SetPenWidth(10)
srf:SetColor(0.5,0.5,0.5,1) srf:FillRectangle( 20, 20, w-40, h-40 )
srf:SetPenWidth(1)
srf:SetColor(1,0,0,1) srf:DrawRectangle( 20, 20, w-40, h-40 );
fch,err,msg = srf:Dump("/tmp","Line")
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()