OpenSiv3D  v0.6.5
C++20 framework for creative coding
s3d::ScreenCapture Namespace Reference

スクリーンショットに関連する機能 More...

Functions

FilePath GetScreenshotDirectory ()
 現在設定されている、スクリーンショットの保存先のディレクトリを取得します。 More...
 
void SetScreenshotDirectory (FilePath &&path)
 スクリーンショットの保存先のディレクトリを変更します。 More...
 
void SaveCurrentFrame (FilePath &&path=(DateTime::Now().format(U"yyyyMMdd-HHmmss-SSS")+U".png"))
 現在のフレームを次の System::Update() でスクリーンショットとして保存します。 More...
 
void RequestCurrentFrame ()
 現在のフレームのスクリーンショットを、次の System::Update() でメモリ上に保存します。 More...
 
bool HasNewFrame ()
 メモリ上に新しいスクリーンショットが保存されているかを返します。 More...
 
const ImageGetFrame ()
 メモリ上に保存されているスクリーンショットを取得します。 More...
 
bool GetFrame (Image &image)
 メモリ上に保存されているスクリーンショットを取得します。 More...
 
bool GetFrame (DynamicTexture &texture)
 メモリ上に保存されているスクリーンショットを DynamicTexture に書き込みます。 More...
 
void SetShortcutKeys (const Array< InputGroup > &screenshotShortcutKeys)
 スクリーンショットのショートカットキーを設定します。 More...
 

Detailed Description

スクリーンショットに関連する機能

Remarks
これらの関数を呼ぶ以外にも、OS 固有のスクリーンショットのキーボード操作でスクリーンショットを自動保存します。

Function Documentation

◆ GetFrame() [1/3]

const Image& s3d::ScreenCapture::GetFrame ( )

メモリ上に保存されているスクリーンショットを取得します。

Returns
メモリ上に新しいスクリーンショットが保存されている場合その画像、それ以外の場合は空の画像

◆ GetFrame() [2/3]

bool s3d::ScreenCapture::GetFrame ( DynamicTexture texture)

メモリ上に保存されているスクリーンショットを DynamicTexture に書き込みます。

Parameters
textureスクリーンショットの書き込み先
Remarks
DynamicTexture はスクリーンショットと同じ解像度か、空でなければこの関数は失敗します。
Returns
メモリ上に新しいスクリーンショットが保存されていて、そのスクリーンショットの書き込みに成功した場合 true, それ以外の場合は false

◆ GetFrame() [3/3]

bool s3d::ScreenCapture::GetFrame ( Image image)

メモリ上に保存されているスクリーンショットを取得します。

Parameters
image取得した画像のコピー先
Returns
メモリ上に新しいスクリーンショットが保存されていて、その取得に成功した場合 true, それ以外の場合は false

◆ GetScreenshotDirectory()

FilePath s3d::ScreenCapture::GetScreenshotDirectory ( )

現在設定されている、スクリーンショットの保存先のディレクトリを取得します。

Returns
スクリーンショットの保存先のディレクトリ

◆ HasNewFrame()

bool s3d::ScreenCapture::HasNewFrame ( )

メモリ上に新しいスクリーンショットが保存されているかを返します。

Remarks
直前のフレームで ScreenCapture::Request() を呼んだ場合のみ true を返します。
Returns
メモリ上に新しいスクリーンショットが保存されている場合 true, それ以外の場合は false

◆ RequestCurrentFrame()

void s3d::ScreenCapture::RequestCurrentFrame ( )

現在のフレームのスクリーンショットを、次の System::Update() でメモリ上に保存します。

Remarks
保存されたスクリーンショットは、ScreenCapture::GetFrame() を通して取得できます。

◆ SaveCurrentFrame()

void s3d::ScreenCapture::SaveCurrentFrame ( FilePath &&  path = (DateTime::Now().format(U"yyyyMMdd-HHmmss-SSS")+U".png"))

現在のフレームを次の System::Update() でスクリーンショットとして保存します。

Parameters
path保存するスクリーンショットのファイル名

◆ SetScreenshotDirectory()

void s3d::ScreenCapture::SetScreenshotDirectory ( FilePath &&  path)

スクリーンショットの保存先のディレクトリを変更します。

Parameters
path新しい保存先のディレクトリ

◆ SetShortcutKeys()

void s3d::ScreenCapture::SetShortcutKeys ( const Array< InputGroup > &  screenshotShortcutKeys)

スクリーンショットのショートカットキーを設定します。

Remarks
デフォルトでは { KeyPrintScreen, KeyF12 } です。
Parameters
screenshotShortcutKeysスクリーンショットのショートカットキー