目次→描画ライブラリー参考→
描画画面関連→
SCREENINFO←オリジナル・サイト
現在のビデオモードとデスクトップの情報を検索します。
構文:
declare sub Screeninfo ( byref w as long = 0, byref h as long = 0, byref depth as long = 0, byref bpp as long = 0, byref pitch as long = 0, byref rate as long = 0, byref driver as string = "" )
declare sub Screeninfo ( byref w as longint, byref h as longint, byref depth as longint = 0, byref bpp as longint = 0, byref pitch as longint = 0, byref rate as longint = 0, byref driver as string = "" )
用法:
in the LONG (or INTEGER<32>) version of the sub:
Screeninfo [ w ] [, [ h ] [, [ depth ] [, [ bpp ] [, [ pitch ] [, [ rate ] [, driver ]]]]]]
in the LONGINT (or INTEGER<64>) version of the sub:
Screeninfo w , h [, [ depth ] [, [ bpp ] [, [ pitch ] [, [ rate ] [, driver ]]]]]
パラメタ:
w
幅。
h
高さ。
depth
色の深さ(ビット)。
bpp
1画素あたりのバイト。
pitch
1走査行あたりのバイト。
rate
リフレッシュ・レート(垂直走査周波数)。
driver
ドライバー名。
記述:
この関数は、グラフィック・ドライバー名、色の深度、画面サイズなど、現在の状態の情報を取得するために役に立ちます。
グラフィック・モードが設定されていないときに、Screeninfo を呼ぶと、デスクトップの情報を返します。
以下は、利用可能な項目の内容です:
w
| 画面の幅(ピクセル:画素)
|
h
| 画面の高さ(ピクセル:画素)
|
depth
深さ
|
現在のピクセル形式の、1画素あたりのビット数:
1、2、4、8、16、または 32
|
bpp
|
画素あたりのバイト数:Bytes per pixel
|
pitch
ピッチ
|
バイトで表現される、フレームバッファ列のサイズ
|
rate
レート
|
現在のリフレッシュレート。未知の場合、0となります。
|
driver
ドライバー
|
使用中の現在のグラフィックスドライバーの名前:
DirectX(新しいシステムに追加されたDirect2D)や X11 など
|
例:
注:FreeBASIC 1.08〜 で、SetEnviron を追加しなくても、日本語環境で描画画面が表示されるように改善されました。
' Sets the graphics method GDI
' 描画方法を GDI に設定
SetEnviron("fbgfx=GDI")
Dim w
As Long, h
As Long
Dim depth
As Long
Dim driver_name
As String
Screen 15,
32
' 現在のモードに関する情報を取得します
ScreenInfo w, h, depth,,,,driver_name
Print Str(w
) +
"x" +
Str(h
) +
"x" +
Str(depth
);
Print " using " + driver_name +
" driver"
Sleep
' 描画モードを終了して、デスクトップに関する情報を取得します
Screen 0
ScreenInfo w, h, depth
Print "Desktop running at " +
Str(w
) +
"x" +
Str(h
) +
"x" +
Str(depth
);
Sleep
バージョン:
- fbc 1.08.0 より前:
構文:
用法:
Screeninfo [ w ] [, [ h ] [, [ depth ] [ , [ bpp ] [ , [ pitch ] [ , [ rate ] [, driver ]]]]]]
方言差:
-
別名 __Screeninfo 参照をつけないと、 -lang qb 方言でつかえません。
QBからの違い:
参照: