save a screenshot is not working, why?
Posted: Mon Oct 24, 2011 7:47 am
Hi,
I'm trying to simply save a screenshot in a bmp image. I'm listening to a mouse click to take the screenshot and I'm executing:
local s = love.graphics.newScreenshot() --ImageData
local d = love.image.newEncodedImageData(s, "bmp")
local success = love.filesystem.write("pic.bmp", d)
but I get the following error:
'Data could not be written'
I also tried to set the identity to a 'sheet' folder but it's not working. I've also tried to use the :encode("bmp") function instead of newEncodedImageData but it's not working. Any idea what I do wrong?
note: I'm dragging and dropping my folder on a shortcut of love.exe, but that should not be a problem right?
thanks for the help!
I'm trying to simply save a screenshot in a bmp image. I'm listening to a mouse click to take the screenshot and I'm executing:
local s = love.graphics.newScreenshot() --ImageData
local d = love.image.newEncodedImageData(s, "bmp")
local success = love.filesystem.write("pic.bmp", d)
but I get the following error:
'Data could not be written'
I also tried to set the identity to a 'sheet' folder but it's not working. I've also tried to use the :encode("bmp") function instead of newEncodedImageData but it's not working. Any idea what I do wrong?
note: I'm dragging and dropping my folder on a shortcut of love.exe, but that should not be a problem right?
thanks for the help!