{{oldin|[[11.0]]|110|type=function|text=It has been replaced by [[love.graphics.captureScreenshot]]}}
Creates a screenshot and returns the image data.
{{newobjectnotice}}

== Function ==
=== Synopsis ===
<source lang="lua">
screenshot = love.graphics.newScreenshot( )
</source>
=== Arguments ===
None.
=== Returns ===
{{param|ImageData|screenshot|The image data of the screenshot.}}

== Function ==
{{newin|[[0.9.0]]|090|type=variant}}
=== Synopsis ===
<source lang="lua">
screenshot = love.graphics.newScreenshot( copyAlpha )
</source>
=== Arguments ===
{{param|boolean|copyAlpha (false)|Whether to include the screen's alpha channel in the ImageData. If false, the screenshot will be fully opaque.}}
=== Returns ===
{{param|ImageData|screenshot|The image data of the screenshot.}}

== Examples ==
Create a new screenshot and write it to the save directory.
<source lang="lua">
function love.load()
    love.filesystem.setIdentity('screenshot_example');
end

function love.keypressed()
    local screenshot = love.graphics.newScreenshot();
    screenshot:encode('png', os.time() .. '.png');
end
</source>

== See Also ==
* [[parent::love.graphics]]
* [[Constructs::ImageData]]
* [[ImageData:encode]]
[[Category:Functions]]
{{#set:Description=Creates a screenshot and returns the [[ImageData]].}}
{{#set:Since=000}}
{{#set:Sub-Category=Object Creation}}
== Other Languages ==
{{i18n|love.graphics.newScreenshot}}