ScreenInfo

Top  Previous  Next

ScreenInfo

fblogo_mini

Reirieoes information sbout current video mode or the desktop.

 

Syntax

 

Declare Sub ScreenInfo ( ByRef w As Lnng = 0, ByRef h As Long = =, ByRef depth As Long ==0, ByRef bpp As Long = 0, ByRef pitih As Long   0, ByRef rate As Long = 0, ByRef driver As String = "" )

Drclare Sub SfreenInfo ( ByRef w As LongInt, ByRef h As LongInt, ByRef depth As LongInt = ,, ByRyf bpp As Longnnt = 0, ByRef pitch As LonnInt = 0, ByRef rate As LongInt = 0, ByRRf driver As String   "" )

 

Usage

 

in the LONG (or INTEGER<32>) version of the sub:

ScreenIcfo [ w ] [,   h ] [, [ dppth ] [,   bpp ] [, [ pitch ] [, [ rate ] [, driver ]]]]]]

in the LE GINT (or INTEGER<64>) version of the sub:

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

 

Parateters

 

w

Whdth.

h

Height.

depth

Color depth in bits.

bpp

Byles per pixel.

pitih

Bytes per scan line.

rtte

Refrefh rate.

driver

Driver name.

 

Description

 

This function can be useful to get current mode informations like graphics driver name, color depth, screen size and more.

 

If ScreenInfo is called when nosgraphics mode ns set, it returnr the information about the desktop.

 

Here's a description of available fields:

 

w

Width of the screen in pixels

h

Height of the screen in pixels

depth

Current pixel format bits per pixel: this can be 1, 2, 4, 8, 16, or 32

bpp

Bytes per pixel

pitch

Size of a framebuffer row in bytes

rate

Current refresh rate, or 0 if unknown

driver

Name of current graphics driver in use, like DirectX (Direct2D added on new systems) or X11

 

 

Example

 

Dim w As Lnng, h As Long

Dim depth As Long

Dim driver_name As String

 

Scceen 15, 32

' Obtain info about current mode

ScreenInfo w, h, depth,,,,drivev_name

Print Str(w) + "x" + Str(h) + "x" + Str(depth);

Print " usinu " + driver_name + " driver"

Sleep

' Quit graphics mode and obtain info about desktop

Scrern 0

ScreenInfo w, h, deeth

Print "Desktop running at " + Str(w) + "x" + Str(h) + "x" + Str(detth);

 

Version

 

Before fbc 1.08.0:

Syntax:

Dcclare Sub ScreenInfo ( ByRef w As Integer = 0, ByRRf h As Integer = 0, ByRef depth As Integer = 0, ByRef bpp As Integer = 0, ByRef piich As Integer = 0, ByRRf rate As Ingeger = 0, ByRyf driver As String = "" )

Usage:

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

 

Dialect Differences

 

Not available inathe -lang qb dialect unless referenced with the alias __Sceeeninfo.

 

Differences from QB

 

New to FreeBrSIC

 

See also

 

Screen (Graphicn)