注册 登录
Small Basic中文站-快乐编程 返回首页

rock的个人空间 http://www.smallbasic.cn/?5 [收藏] [复制] [分享] [RSS]

日志

SmallBasic API大全-GraphicsWindow属性和方法

已有 3024 次阅读2010-6-14 13:17 |个人分类:技术交流|


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.

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

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

xThe x co-ordinate of the text start point. yThe y co-ordinate of the text start point. widthThe maximum available width. This parameter helps define when the text should wrap. textThe text to draw. ReturnsNothing
DrawEllipse
GraphicsWindow.DrawEllipse(x, y, width, height)

Draws an ellipse on the screen using the selected Pen.

xThe x co-ordinate of the ellipse. yThe y co-ordinate of the ellipse. widthThe width of the ellipse. heightThe height of the ellipse. ReturnsNothing
DrawImage
GraphicsWindow.DrawImage(imageName, x, y)

Draws the specified image from memory on to the screen.

imageNameThe name of the image to draw. xThe x co-ordinate of the point to draw the image at. yThe y co-ordinate of the point to draw the image at. ReturnsNothing
DrawLine
GraphicsWindow.DrawLine(x1, y1, x2, y2)

Draws a line from one point to another.

x1The x co-ordinate of the first point. y1The y co-ordinate of the first point. x2The x co-ordinate of the second point. y2The y co-ordinate of the second point. ReturnsNothing
DrawRectangle
GraphicsWindow.DrawRectangle(x, y, width, height)

Draws a rectangle on the screen using the selected Pen.

xThe x co-ordinate of the rectangle. yThe y co-ordinate of the rectangle. widthThe width of the rectangle. heightThe height of the rectangle. ReturnsNothing
DrawResizedImage
GraphicsWindow.DrawResizedImage(imageName, x, y, width, height)

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

imageNameThe name of the image to draw xThe x co-ordinate of the point to draw the image at. yThe y co-ordinate of the point to draw the image at. widthThe width to draw the image. heightThe height to draw the image. ReturnsNothing
DrawText
GraphicsWindow.DrawText(x, y, text)

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

xThe x co-ordinate of the text start point. yThe y co-ordinate of the text start point. textThe text to draw ReturnsNothing
DrawTriangle
GraphicsWindow.DrawTriangle(x1, y1, x2, y2, x3, y3)

Draws a triangle on the screen using the selected pen.

x1The x co-ordinate of the first point. y1The y co-ordinate of the first point. x2The x co-ordinate of the second point. y2The y co-ordinate of the second point. x3The x co-ordinate of the third point. y3The y co-ordinate of the third point. ReturnsNothing
FillEllipse
GraphicsWindow.FillEllipse(x, y, width, height)

Fills an ellipse on the screen using the selected Brush.

xThe x co-ordinate of the ellipse. yThe y co-ordinate of the ellipse. widthThe width of the ellipse. heightThe height of the ellipse. ReturnsNothing
FillRectangle
GraphicsWindow.FillRectangle(x, y, width, height)

Fills a rectangle on the screen using the selected Brush.

xThe x co-ordinate of the rectangle. yThe y co-ordinate of the rectangle. widthThe width of the rectangle. heightThe height of the rectangle. ReturnsNothing
FillTriangle
GraphicsWindow.FillTriangle(x1, y1, x2, y2, x3, y3)

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

x1The x co-ordinate of the first point. y1The y co-ordinate of the first point. x2The x co-ordinate of the second point. y2The y co-ordinate of the second point. x3The x co-ordinate of the third point. y3The y co-ordinate of the third point. ReturnsNothing
GetColorFromRGB
GraphicsWindow.GetColorFromRGB(red, green, blue)

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

redThe red component of the Color (0-255). greenThe green component of the color (0-255). blueThe blue component of the color (0-255). ReturnsReturns 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.

xThe x co-ordinate of the pixel. yThe y co-ordinate of the pixel. ReturnsThe color of the pixel.
GetRandomColor
GraphicsWindow.GetRandomColor()

Gets a valid random color.

ReturnsA valid random color.
Hide
GraphicsWindow.Hide()

Hides the Graphics window.

ReturnsNothing
SetPixel
GraphicsWindow.SetPixel(x, y, color)

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

xThe x co-ordinate of the pixel. yThe y co-ordinate of the pixel. colorThe color of the pixel to set. ReturnsNothing
Show
GraphicsWindow.Show()

Shows the Graphics window to enable interactions with it.

ReturnsNothing
ShowMessage
GraphicsWindow.ShowMessage(text, title)

Displays a message box to the user.

textThe text to be displayed on the message box. titleThe title for the message box. ReturnsNothing

路过

鸡蛋

鲜花

握手

雷人

评论 (0 个评论)

facelist

您需要登录后才可以评论 登录 | 注册

QQ|手机版|Small Basic中文站-快乐编程 ( 闽ICP备09051788号 |

GMT+8, 2019-1-17 23:54 , Processed in 0.129942 second(s), 9 queries , File On.

Powered by Discuz! X3.3

返回顶部