LitDev Extension API

GW LD3DView LDArray LDBits LDBlueTooth
LDCall LDChart LDClient LDClipboard LDColours
LDCommPort LDController LDControls LDCursors LDDataBase
LDDateTime LDDebug LDDialogs LDDictionary LDEffect
LDEmail LDEncryption LDEvents LDFastArray LDFastShapes
LDFigures LDFile LDFinances LDFocus LDftp
LDGeography LDGraph LDGraphicsWindow LDHashTable LDHID
LDIcon LDImage LDInline LDIOWarrior LDList
LDLogic LDMath LDMathX LDMatrix LDMusic
LDNetwork LDPhysics LDProcess LDQueue LDRegex
LDResources LDScrollBars LDSearch LDServer LDSettings
LDShapes LDShell LDSort LDSound LDSpeech
LDStatistics LDStopwatch LDText LDTextWindow LDTimer
LDTranslate LDUnits LDUtilities LDVector LDWaveForm
LDWebCam LDWindows LDxml LDZip TW

LDGraphicsWindow
GraphicsWindow utilities.

Animate BackgroundBrush BackgroundImage
CancelClose Capture Closing
ExitButtonMode ExitOnClose FloodFill
FloodFillTolerance GetPixel Height
Icon MouseX MouseXOffset
MouseXScale MouseY MouseYOffset
MouseYScale PauseUpdates Print
Reposition RepositionedMouseX RepositionedMouseY
RepositionPoint Resize ResumeUpdates
ScreenCapture SetActive SetFontFromFile
ShowInTaskbar State Style
TopMost TransparentGW Width

Animate(scaleX,scaleY,panX,panY,angle,duration)
Scale and move all Shapes and Controls within the GraphicsWindow, by smooth animation.
This is the same as the Reposition method except that the movement is animated.

scaleX The X direction scaling of the view.
scaleY The Y direction scaling of the view.
panX Pan the view in the X direction in the view scaling, 0 is centered in the GraphicsWindow.
panY Pan the view in the Y direction in the view scaling, 0 is centered in the GraphicsWindow.
angle An angle to rotate the view.
duration The time for the animation, in milliseconds.

BackgroundBrush(brush)
Set the background as a gradient of colours.
brush A previously created gradient or image brush (LDShapes.BrushGradient LDShapes.BrushImage).
returns None.

BackgroundImage(imageName)
Set the background as an image.
The backgound is auto rescaled to fill whatever size the GraphicsWindow is.

imageName The image to load as the background.
Value returned from ImageList.LoadImage or local or network image file.

returns None.

CancelClose
Cancel the next GraphicsWindow Close operation "True" or "False" (default).
Requires ExitOnClose to be set to "False".
This should usually be set inside Closing event, possibly using LDDialogs.Confirm.
It will be reset to "False" after a closure is prevented.


Capture(fileName,border)
Save the GraphicsWindow as an image file (png, jpg, bmp, gif, tiff or ico).

The window must be visible and a short delay may be required after updating the window before calling.

fileName The file to save the image to (*.png, *.jpg, *.bmp, *.gif, *.tiff or *.ico).
If this is set to "", then the image is created internally as an ImageList.

border Include the window border ("True" or "False").
returns The ImageList image if fileName is "", otherwise if output to a file, then "" is returned.

Closing
Event when a GraphicsWindow is closed.
ExitOnClose must be set to "False" to use this event.
If CancelClose is set to true, then the closure will be cancelled.


ExitButtonMode(window,mode)
Set the mode of the close button for a window.
window The window title, e.g. TextWindow.Title or GraphicsWindow.Title.
mode The mode "Enabled", "Disabled")

ExitOnClose
Set whether the SmallBasic program is ended when a GraphicsWindow is closed "True" (default) or "False".
If set to false, the program must still have something running to continue.


FloodFill(x,y,colour)
Fill a region surrounding a specified pixel.
All neighbour pixels of the same colour are changed.
This only applies to the drawing layer of the GraphicsWindow.

x The x co-ordinate of the pixel to start the fill.
y The y co-ordinate of the pixel to start the fill.
colour The colour to fill with.

FloodFillTolerance
A tolerance for FloodFill method (0 to 100).
0 is default and only pixels of exactly the same colour are changed, 100 changes all pixels apart from new fill colour.


GetPixel(x,y)
Gets the color of the pixel at the specified x and y co-ordinates.
This method works for background, drawing and shape layers.

x The x co-ordinate of the pixel.
y The y co-ordinate of the pixel.
returns The color of the pixel.

Height
Set or get the GraphicsWindow height if using LDScrollBars

Icon
Set the GraphicsWindow Icon, "SB" sets to Small Basic icon.

MouseX
Move the mouse to GraphicsWindow X coordinate.
Set as well as get.


MouseXOffset
Scaling of GraphicsWindow to Desktop coordinates.
Mouse.X = MouseXOffset + MouseXScale * GraphicsWindow.MouseX.


MouseXScale
Scaling of GraphicsWindow to Desktop coordinates.
Mouse.X = MouseXOffset + MouseXScale * GraphicsWindow.MouseX.


MouseY
Move the mouse to GraphicsWindow Y coordinate.
Set as well as get.


MouseYOffset
Scaling of GraphicsWindow to Desktop coordinates.
Mouse.Y = MouseYOffset + MouseYScale * GraphicsWindow.MouseY.


MouseYScale
Scaling of GraphicsWindow to Desktop coordinates.
Mouse.Y = MouseYOffset + MouseYScale * GraphicsWindow.MouseY.


PauseUpdates()
Pause GraphicsWindow Updates.
returns None.

Print(border)
Print the GraphicsWindow contents.

The window must be visible and a short delay may be required after updating the window before calling.

border Include the window border ("True" or "False").
returns None.

Reposition(scaleX,scaleY,panX,panY,angle)
Scale and move all Shapes and Controls within the GraphicsWindow.
This method resizes and moves the view rather than the shapes, so their positions and other properties remain unchanged but appear scaled within the repositioned region.
For example Shapes.GetLeft remains unchanged although the view has been repositioned and GraphicsWindow.MouseX reports the coordinates relative to the repositioned view.
Imagine the entire view is repositioned as if it were a shape inside the GrapicsWindow.
The transformation between view coordinates (vX,vY) and GraphicsWindow coordinates (gwX,gwY) is:
gwX = (vX+panX)*scaleX + gw*(1-scaleX)/2
gwY = (vY+panY)*scaleY + gh*(1-scaleY)/2
All drawing remains within the original GraphicsWindow.

scaleX The X direction scaling of the view.
scaleY The Y direction scaling of the view.
panX Pan the view in the X direction in the view scaling, 0 is centered in the GraphicsWindow.
panY Pan the view in the Y direction in the view scaling, 0 is centered in the GraphicsWindow.
angle An angle to rotate the view.

RepositionedMouseX
The mouse X GraphicsWindow coordinate in a repositioned view (see Reposition).

RepositionedMouseY
The mouse GraphicsWindow Y coordinate in a repositioned view (see Reposition).

RepositionPoint(x,y,toGW)
Get coordinates transformed between GraphicsWindow and a repositioned View (See Reposition).
x The x coordinate to transform.
y The x coordinate to transform.
toGW Transfer from View to GraphicsWindow ("True") or from GraphicsWindow to View ("False").
returns A 2D array of transformed coordinates indexed by 1 and 2.

Resize
The GraphicsWindow resize mode (CanMinimize 0, CanResize 1, CanResizeWithGrip 2, NoResize 3).

ResumeUpdates()
Resume GraphicsWindow Updates.
returns None.

ScreenCapture
Use screen capture for GraphicsWindow image creation.
This only applies to Print and Capture methods when the border option is set to "False"
If this option is set to "True" then the current visable GraphicsWindow is used to create a bitmap.
If this option is set to "False" then the visuals in the GraphicsWindow will be re-rendered to a bitmap.
Default "False"


SetActive()
Set the GraphicsWindow as active (has focus).

SetFontFromFile(fontFile)
Set font in GraphicsWindow from a local TTF font file.
fontFile Full path to font file to set.
returns The font name on success, else "FAILED".

ShowInTaskbar
Show or hide GraphicsWindow in taskbar ("True" or "False")

State
The GraphicsWindow state (Normal 0, Minimised 1, Maximised 2).

Style
The GraphicsWindow style (None 0, SingleBorder 1, 3DBorder 2, ToolWindow 3).

TopMost
Set the GraphicsWindow as the top most window.
The window will remain above other windows even when other windows are in focus.
"True" or "False".


TransparentGW()
Create a transparent GraphicsWindow.
This must be the called before any other GraphicsWindow, Controls or Shapes methods that create a window.
To see anything you must add something to the transparent GraphicsWindow.
For example, create a non-rectangular window using a transparent border png with LDShapes.BackgroundImage.
The transparency can be altered with GraphicsWindow.BackgroundColor.
Sometimes less than 100% transparency can be required (e.g. to register mouse movements).


Width
Set or get the GraphicsWindow width if using LDScrollBars