< Previous | Contents | Next >

Example

The following example is taken from the SourceTest.Fuse example found at Example_Fuses


local img = Image(imgattrs)


local random = math.random -- faster in a local

local p = Pixel({A=1}) for y=0,Height-1 do

if self.Status ~= "OK" then break end


for x=0,Width-1 do

p.R = random()

p.G = random()

p.B = random() img:SetPixel(x,y, p)

end

end


OutImage:Set(req, img)