Matty #1 Setbuffer(h) is wrong as h is not a buffer but an image handle, you need to do as follows:setbuffer(imagebuffer(h))