Revision [13934]

This is an old revision of KeyPgScreencontrol made by LaananFisher on 2008-11-29 15:55:36.

 

SCREENCONTROL


Sets or gets internal graphics library settings

Syntax:
Usage:
ScreenControl( what [, [ param1 ][, [ param2 ][, [ param3 ][, [ param4 ]]]]] )
or,
ScreenControl( what [, param ] )

Parameters:
what
specifies the function to perform
param1
optional first integer parameter, contains value to be set on entry or value got on exit
param2
optional second integer parameter, contains value to be set on entry or value got on exit
param3
optional third integer parameter, contains value to be set on entry or value got on exit
param4
optional fourth integer parameter, contains value to be set on entry or value got on exit
param
optional string parameter, contains text to be set on entry or text got on exit

Description:
This function can be used to set or get internal GfxLib states. The what parameter specifies which operation to perform. On operations that set states, the param* parameters must contain the values to be set. On operations that get states, param* will hold the values returned by GfxLib when the function returns.
The meaning of the param* parameters depend on the what parameter, whose possible values are defined as constants in fbgfx.bi. In CompilerDialects lang fb, they are set to be stored in the FB KeyPgNamespace Namespace.
Below is a list of the supported what constants - and their values as defined at time of writing - along with the parameters associated with them.
Supported operations

Note: * denotes operations that are allowed while a graphics mode has not yet been set via KeyPgScreengraphics Screen (Graphics) or KeyPgScreenres ScreenRes. For all other operations, return values are zero(0) or the empty string("") and the operation has no effect if a graphics mode is not available at call time.

Get operations
Set operations
Other operations

Examples:
'' include fbgfx.bi for some useful definitions
#include "fbgfx.bi"

Using fb

Dim e As EVENT
Dim As Integer x, y, pressed, col
Dim As Any Ptr img

ScreenRes 384, 64, 32,, GFX_SHAPED_WINDOW

'' create a fancy window shape
img = ImageCreate(48,8)
Draw String img, (0, 0), "GfxLib"
For y = 0 To 63
    For x = 0 To 383
        col = Point(x \ 8, y \ 8, img)
        If (col <> RGB(255, 0, 255)) Then
            col = RGB((x + y) And &hFF, (x + y) And &hFF, (x + y) And &hFF)
        End If
        PSet (x, y), col
    Next x
Next y

pressed = 0
Do
    If (ScreenEvent(@e)) Then
        Select Case e.Type
        Case EVENT_MOUSE_BUTTON_PRESS
            pressed = -1
        Case EVENT_MOUSE_BUTTON_RELEASE
            pressed = 0
        Case EVENT_MOUSE_MOVE
            If (pressed) Then
                ScreenControl GET_WINDOW_POS, x, y
                ScreenControl SET_WINDOW_POS, x + e.dx, y + e.dy
            End If
        End Select
    End If
    Sleep 5
Loop While Not MultiKey(1)



Dialect Differences:
Differences from QB:
See also:
Back to Screen Functions
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki



sf.net phatcode