Images.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 )
print "Loading PNG image"
local img,err = SelDCSurfaceImage.createFromPNG("../HomeDashboard_dev/SeleniteDFB/Images/Poseidon.png")
if not img then
print("*E*",err)
os.exit(EXIT_FAILURE)
end
print("Image size = ", img:GetSize())
srf:Blit(img, 200,0)
local wimg,himg = img:GetSize()
srf:Blit(img, 70,100)
srf:SetColor(1,0,0)
srf:Blit(img, 300,350, wimg/2, himg/2 )
srf:DrawRectangle(300,350, wimg/2, himg/2)
srf:Blit(img, 500,350, 0,0, wimg/2, himg/2 )
srf:DrawRectangle(500,350, wimg/2, himg/2)
srf:Scale(0.25, 0.15)
srf:Blit(img, 450,150)
img:Release()
fch,err,msg = srf:Dump("/tmp","Image")
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()