Repository navigation
Screeninfo
Home › Screen Functions › ScreenInfo
Fills in the screen's width, height, depth and driver, or the desktop's if none is open.
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 = "" )whdepthbpppitchratedriver
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 no graphics mode is set, it returns 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 |
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 ]]]]]- Not available in the -lang qb dialect unless referenced with the alias
__Screeninfo.
- New to FreeBASIC
Dim w As Long, h As Long
Dim depth As Long
Dim driver_name As String
Screen 15, 32
' Obtain info about current mode
ScreenInfo w, h, depth,,,,driver_name
Print Str(w) + "x" + Str(h) + "x" + Str(depth);
Print " using " + driver_name + " driver"
Sleep
' Quit graphics mode and obtain info about desktop
Screen 0
ScreenInfo w, h, depth
Print "Desktop running at " + Str(w) + "x" + Str(h) + "x" + Str(depth);Category: Screen Functions
Kind: sub
Reproduced from the FreeBASIC Wiki Manual under the GNU Free Documentation License 1.3 — with no Invariant Sections, no Front-Cover Texts and no Back-Cover Texts. Copyright © the FreeBASIC project and wiki contributors. See License.
tiko-lang · Home · Feature Index · Keyword Index · License
FreeBASIC manual pages reproduced under the GNU FDL 1.3.
- Generics
- Interfaces
- For Each
- Iterators
- Tuples
- Array Results
- Defer
- Lambdas
- Block Strings
- String Slices
- Embed
- Typed Variadics
- C Header Import
- Foreign Library Linking
- UString
- Fixed-Width Types
- Nullptr
- String Library
- Format
- Array
- Map
- Set
- LinkedList
- OrderedMap
- OrderedSet
- Sorting
- Optional
- Result
- Smart Pointers
- Date and Time (Chrono)
- Filesystem
- File Streams
- Config (INI and TOML)
- Codec
- Hash
- UUID
- OS
- Process
- Net
- HTTP and TLS
- Math Library
- Finance
- Logging
- Terminal TUI Library
- PsControls
- tkControls
- sys/win
- Goroutines and Channels
- LLVM Backend
- tiko build
- TIKO_COMPILER
- Variable Declarations
- Standard Data Types
- User Defined Types
- Procedures
- Operators
- Control Flow Statements
- Converting Data Types
- Array Functions
- String Functions
- Mathematical Functions
- Bit Manipulation
- Date and Time Functions
- File I/O Functions
- Console Functions
- User Input (Runtime Library)
- User Input Functions (Graphics Library)
- Screen Functions
- 2D Drawing Functions
- Graphics Library Reference
- Graphics Keyword List
- Memory Functions
- Threading Support Functions
- Error Handling Functions
- Operating System Functions
- Preprocessor
- Intrinsic Defines
- Miscellaneous Keywords
- Modularizing