Page 1 of 1

Save Canvas as image to file - 0.8

Posted: Sat Apr 21, 2012 4:09 pm
by larios
Hi,

i had this code pre 0.8

Code: Select all

			local canvasData = canvas:getImageData() 
			local canvasImage = love.image.newEncodedImageData(canvasData, "bmp")
			local success = love.filesystem.write("pic.bmp", canvasImage)
newEncodedImageData seems to be not available anymore(?), how can i repair it?

Re: Save Canvas as image to file - 0.8

Posted: Sat Apr 21, 2012 4:22 pm
by Camewel
If I'm not mistaken, you can replace the second two lines with:

Code: Select all

canvasData:encode("pic.bmp")

Re: Save Canvas as image to file - 0.8

Posted: Sat Apr 21, 2012 5:01 pm
by larios
yes that's right thanks :)