Small Basic API Reference
Arguments

The Arguments object provides operations to access the command-line arguments that were passed at the start of this program.

Array

This object provides a way of storing more than one value for a given name. These values can be accessed by another index.

Clock

This class provides access to the system clock

Desktop

This class provides methods to interact with the desktop.

Dictionary

This class provides access to an online Dictionary service.

File

The File object provides methods to access, read and write information from and to a file on disk. Using this object, it is possible to save and open settings across multiple sessions of your program.

Flickr

This class provides access to Flickr photo services.

GraphicsWindow

The GraphicsWindow provides graphics related input and output functionality. For example, using this class, it is possible to draw and fill circles and rectangles.

ImageList

This class helps to load and store images in memory.

Math

The Math class provides lots of useful mathematics related methods

Mouse

The mouse class provides accessors to get or set the mouse related properties, like the cursor position, pointer, etc.

Network

This private helper class provides network access methods

Program

The Program class provides helpers to control the program execution.

Shapes

The Shape object allows you to add, move and rotate shapes to the Graphics window.

Sound

The Sound object provides operations that allow the playback of sounds. Some sample sounds are provided along with the library.

Stack

This object provides a way of storing values just like stacking up a plate. You can push a value to the top of the stack and pop it off. You can only pop the values one by one off the stack and the last pushed value will be the first one to pop out.

Text

The Text object provides helpful operations for working with Text.

TextWindow

The TextWindow provides text-related input and output functionalities. For example using this class, it is possible to write or read some text or number to and from the text-based text window.

Timer

The Timer object provides an easy way for doing something repeatedly with a constant interval between.

Turtle

The Turtle provides Logo-like functionality to draw shapes by manipulating the properties of a pen and drawing primitives.


GraphicsWindow

The GraphicsWindow provides graphics related input and output functionality. For example, using this class, it is possible to draw and fill circles and rectangles.

Properties

BackgroundColor

GraphicsWindow.BackgroundColor

Gets or sets the Background color of the Graphics Window.

BrushColor

GraphicsWindow.BrushColor

Gets or sets the brush color to be used to fill shapes drawn on the Graphics Window.

CanResize

GraphicsWindow.CanResize

Specifies whether or not the Graphics Window can be resized by the user.

FontBold

GraphicsWindow.FontBold

Gets or sets whether or not the font to be used when drawing text on the Graphics Window, is bold.

FontItalic

GraphicsWindow.FontItalic

Gets or sets whether or not the font to be used when drawing text on the Graphics Window, is italic.

FontName

GraphicsWindow.FontName

Gets or sets the Font Name to be used when drawing text on the Graphics Window.

FontSize

GraphicsWindow.FontSize

Gets or sets the Font Size to be used when drawing text on the Graphics Window.

Height

GraphicsWindow.Height

Gets or sets the Height of the graphics window.

LastKey (This property is read-only.)

GraphicsWindow.LastKey

Gets the last key that was pressed or released.

Left

GraphicsWindow.Left

Gets or sets the Left Position of the graphics window.

MouseX (This property is read-only.)

GraphicsWindow.MouseX

Gets the x-position of the mouse relative to the Graphics Window.

MouseY (This property is read-only.)

GraphicsWindow.MouseY

Gets the y-position of the mouse relative to the Graphics Window.

PenColor

GraphicsWindow.PenColor

Gets or sets the color of the pen used to draw shapes on the Graphics Window.

PenWidth

GraphicsWindow.PenWidth

Gets or sets the width of the pen used to draw shapes on the Graphics Window.

Title

GraphicsWindow.Title

Gets or sets the title for the graphics window.

Top

GraphicsWindow.Top

Gets or sets the Top Position of the graphics window.

Width

GraphicsWindow.Width

Gets or sets the Width of the graphics window.

Events

KeyDown

GraphicsWindow.KeyDown

Raises an event when a key is pressed down on the keyboard.

KeyUp

GraphicsWindow.KeyUp

Raises an event when a key is released on the keyboard.

MouseDown

GraphicsWindow.MouseDown

Raises an event when the mouse button is clicked down.

MouseMove

GraphicsWindow.MouseMove

Raises an event when the mouse is moved around.

MouseUp

GraphicsWindow.MouseUp

Raises an event when the mouse button is released.

Methods

Clear

GraphicsWindow.Clear()

Clears the window.

Returns

Nothing

DrawBoundText

GraphicsWindow.DrawBoundText(x, y, width, text)

Draws a line of text on the screen at the specified location.

x

The x co-ordinate of the text start point.

y

The y co-ordinate of the text start point.

width

The maximum available width. This parameter helps define when the text should wrap.

text

The text to draw.

Returns

Nothing

DrawEllipse

GraphicsWindow.DrawEllipse(x, y, width, height)

Draws an ellipse on the screen using the selected Pen.

x

The x co-ordinate of the ellipse.

y

The y co-ordinate of the ellipse.

width

The width of the ellipse.

height

The height of the ellipse.

Returns

Nothing

DrawImage

GraphicsWindow.DrawImage(imageName, x, y)

Draws the specified image from memory on to the screen.

imageName

The name of the image to draw.

x

The x co-ordinate of the point to draw the image at.

y

The y co-ordinate of the point to draw the image at.

Returns

Nothing

DrawLine

GraphicsWindow.DrawLine(x1, y1, x2, y2)

Draws a line from one point to another.

x1

The x co-ordinate of the first point.

y1

The y co-ordinate of the first point.

x2

The x co-ordinate of the second point.

y2

The y co-ordinate of the second point.

Returns

Nothing

DrawRectangle

GraphicsWindow.DrawRectangle(x, y, width, height)

Draws a rectangle on the screen using the selected Pen.

x

The x co-ordinate of the rectangle.

y

The y co-ordinate of the rectangle.

width

The width of the rectangle.

height

The height of the rectangle.

Returns

Nothing

DrawResizedImage

GraphicsWindow.DrawResizedImage(imageName, x, y, width, height)

Draws the specified image from memory on to the screen, in the specified size.

imageName

The name of the image to draw

x

The x co-ordinate of the point to draw the image at.

y

The y co-ordinate of the point to draw the image at.

width

The width to draw the image.

height

The height to draw the image.

Returns

Nothing

DrawText

GraphicsWindow.DrawText(x, y, text)

Draws a line of text on the screen at the specified location.

x

The x co-ordinate of the text start point.

y

The y co-ordinate of the text start point.

text

The text to draw

Returns

Nothing

DrawTriangle

GraphicsWindow.DrawTriangle(x1, y1, x2, y2, x3, y3)

Draws a triangle on the screen using the selected pen.

x1

The x co-ordinate of the first point.

y1

The y co-ordinate of the first point.

x2

The x co-ordinate of the second point.

y2

The y co-ordinate of the second point.

x3

The x co-ordinate of the third point.

y3

The y co-ordinate of the third point.

Returns

Nothing

FillEllipse

GraphicsWindow.FillEllipse(x, y, width, height)

Fills an ellipse on the screen using the selected Brush.

x

The x co-ordinate of the ellipse.

y

The y co-ordinate of the ellipse.

width

The width of the ellipse.

height

The height of the ellipse.

Returns

Nothing

FillRectangle

GraphicsWindow.FillRectangle(x, y, width, height)

Fills a rectangle on the screen using the selected Brush.

x

The x co-ordinate of the rectangle.

y

The y co-ordinate of the rectangle.

width

The width of the rectangle.

height

The height of the rectangle.

Returns

Nothing

FillTriangle

GraphicsWindow.FillTriangle(x1, y1, x2, y2, x3, y3)

Draws and fills a triangle on the screen using the selected brush.

x1

The x co-ordinate of the first point.

y1

The y co-ordinate of the first point.

x2

The x co-ordinate of the second point.

y2

The y co-ordinate of the second point.

x3

The x co-ordinate of the third point.

y3

The y co-ordinate of the third point.

Returns

Nothing

GetColorFromRGB

GraphicsWindow.GetColorFromRGB(red, green, blue)

Constructs a color given the Red, Green and Blue values.

red

The red component of the Color (0-255).

green

The green component of the color (0-255).

blue

The blue component of the color (0-255).

Returns

Returns a color that can be used to set the brush or pen color.

GetPixel

GraphicsWindow.GetPixel(x, y)

Gets the color of the pixel at the specified x and y co-ordinates.

x

The x co-ordinate of the pixel.

y

The y co-ordinate of the pixel.

Returns

The color of the pixel.

GetRandomColor

GraphicsWindow.GetRandomColor()

Gets a valid random color.

Returns

A valid random color.

Hide

GraphicsWindow.Hide()

Hides the Graphics window.

Returns

Nothing

SetPixel

GraphicsWindow.SetPixel(x, y, color)

Draws the pixel specified by the x and y co-ordinates using the specified color.

x

The x co-ordinate of the pixel.

y

The y co-ordinate of the pixel.

color

The color of the pixel to set.

Returns

Nothing

Show

GraphicsWindow.Show()

Shows the Graphics window to enable interactions with it.

Returns

Nothing

ShowMessage

GraphicsWindow.ShowMessage(text, title)

Displays a message box to the user.

text

The text to be displayed on the message box.

title

The title for the message box.

Returns

Nothing
(c) Copyright 2009, Microsoft Corporation. All rights reserved.