{{newin|[[11.0]]|110|type=function|text=This function replaces [[love.graphics.newScreenshot]]}}
Creates a screenshot once the current frame is done (after [[love.draw]] has finished).

Since this function enqueues a screenshot capture rather than executing it immediately, it can be called from an input callback or [[love.update]] and it will still capture all of what's drawn to the screen in that frame.

{{notice|This function creates a new [[ImageData]] object and can cause love to slow down significantly if it's called every frame.}}

== 関数 ==
Capture a screenshot and save it to a file at the end of the current frame.
=== 概要 ===
<source lang="lua">
love.graphics.captureScreenshot( filename )
</source>
=== 引数 ===
{{param (日本語)|string|filename|The filename to save the screenshot to. The encoded image type is determined based on the extension of the filename, and must be one of the [[ImageFormat]]s.}}
=== 返値 ===
ありません。

== 関数 ==
Capture a screenshot and call a callback with the generated [[ImageData]] at the end of the current frame.
=== 概要 ===
<source lang="lua">
love.graphics.captureScreenshot( callback )
</source>
=== 引数 ===
{{param (日本語)|function|callback|Function which gets called once the screenshot has been captured. An [[ImageData]] is passed into the function as its only argument.}}
=== 返値 ===
ありません。

== 関数 ==
Capture a screenshot and push the generated [[ImageData]] to a [[Channel]] at the end of the current frame.
=== 概要 ===
<source lang="lua">
love.graphics.captureScreenshot( channel )
</source>
=== 引数 ===
{{param (日本語)|Channel|channel|The Channel to [[Channel:push|push]] the generated [[ImageData]] to.}}
=== 返値 ===
ありません。

== 用例 ==
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(key)
    if key == "c" then
        love.graphics.captureScreenshot(os.time() .. ".png")
    end
end

function love.draw()
    love.graphics.circle("fill", 400, 300, 200)
end
</source>

== 関連 ==
* [[parent::love.graphics (日本語)]]
* [[ImageData (日本語)]]
* [[ImageData:encode (日本語)]]
* [[Channel (日本語)]]
[[Category:Functions (日本語)]]
{{#set:Description=Creates a screenshot once the current frame is done.}}
{{#set:Sub-Category=Object Creation (日本語)}}
== そのほかの言語 ==
{{i18n (日本語)|love.graphics.captureScreenshot}}