ScreenInfo
 
检索有关当前视频模式或桌面的信息。

语法

Declare Sub ScreenInfo ( ByRef w As Integer = 0, ByRef h As Integer = 0, ByRef depth As Integer = 0, ByRef bpp As Integer = 0, ByRef pitch As Integer = 0, ByRef rate As Integer = 0, ByRef driver As String = "
" )

用法

ScreenInfo [ w ] [, [ h ] [, [ depth ] [ , [ bpp ] [ , [ pitch ] [ , [ rate ] [, driver ]]]]]

参数

w
宽度。
h
高度。
depth
颜色深度(以位为单位)
bpp
每像素的字节数
pitch
每个扫描线的字节数。
rate
刷新率。
driver
驱动程序名称

说明

此函数可用于获取当前模式信息,如图形驱动程序名称,颜色深度,屏幕尺寸等。

如果未设置图形模式时调用ScreenInfo,则返回有关桌面的信息。

以下是可用字段的说明:

w屏幕宽度(以像素为单位)
h屏幕高度(以像素为单位)
深度当前像素格式每像素位数:这可以是1,2,4,8,16或32
沥青帧缓冲区行的大小(以字节为单位)
当前刷新率,如果未知,则为0
司机正在使用的当前图形驱动程序的名称,如DirectX或X11


例子

Dim w As Integer, h As Integer
Dim depth As Integer
Dim driver_name As String

Screen 15, 32 
'获取有关当前模式的信息
ScreenInfo w, h, depth,,,,driver_name
Print Str(w) + "x" + Str(h) + "x" + Str(depth); 
Print "运用" + driver_name + "司机" 
Sleep 
'退出图形模式并获取有关桌面的信息
Screen 0 
ScreenInfo w, h, depth 
Print "桌面运行在" + Str(w) + "x" + Str(h) + "x" + Str(depth); 


方言差异

  • 除非使用别名__Screeninfo引用,否则在-lang qb 方言中不可用。

与QB差别

  • 新的FreeBASIC

参考