Image.sel

#!./Selene
-- Image example

-- require "tostring" -- debug only
Selene.UseDirectFB("--dfb:quiet,no-vt")
DirectFB.init( DirectFB.CooperativeConst('FULLSCREEN') )	-- Set display cooperative mode

local img,err = SelImage.create("/root/trv/DirectFB-examples-1.2.0/data/wood_andi.jpg")

if img then
	local srf = SelSurface.create {		-- create a surface of image size
		caps=SelSurface.CapabilityConst('PRIMARY')
	}
	local w,h = srf:GetSize()
	srf:Clear( 0,0,0,0 )
	img:RenderTo(
		srf,						-- Destination surface
		{ 20, 20, w-40, h-40  } 	-- Conform to surface size, w/ 20px margine
	)
	img:destroy()	-- The image is not needed anymore

	print "Hit 'enter' key to exit"
	io.stdin:read'*l'	-- wait for enter

	srf:destroy()
else
	print(err)
end
generated by LDoc 1.4.6 Last updated 2022-09-05 22:24:51