C# Класс LitDev.LDGraphicsWindow

Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
_ClosingDelegate SmallBasicCallback

Открытые методы

Метод Описание
BackgroundBrush ( Primitive brush ) : void

Set the background as a gradient of colours.

BackgroundImage ( Primitive imageName ) : void

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

Capture ( Primitive fileName, Primitive border ) : Primitive

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.

ExitButtonMode ( Primitive window, Primitive mode ) : void

Set the mode of the close button for a window.

FloodFill ( Primitive x, Primitive y, Primitive colour ) : void

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.

GetPixel ( Primitive x, Primitive y ) : Primitive

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

PauseUpdates ( ) : void

Pause GraphicsWindow Updates.

Print ( Primitive border ) : void

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

Reposition ( Primitive scaleX, Primitive scaleY, Primitive panX, Primitive panY, Primitive angle ) : void

Scale and move all Shapes and Contols 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.

RepositionPoint ( Primitive x, Primitive y, Primitive toGW ) : Primitive

Get coordinates transformed between GraphicsWindow and a repositioned View (See Reposition).

ResumeUpdates ( ) : void

Resume GraphicsWindow Updates.

SetActive ( ) : void

Set the GraphicsWindow as active (has focus).

SetFontFromFile ( Primitive fontFile ) : Primitive

Set font in GraphicsWindow from a local TTF font file.

TransparentGW ( ) : void

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).

Приватные методы

Метод Описание
BackgroundBrushGradient ( Primitive brush ) : void
GetTransforms ( System.Windows.Controls.Canvas canvas ) : void
_ClosingEvent ( Object sender, CancelEventArgs e ) : void

Описание методов

BackgroundBrush() публичный статический Метод

Set the background as a gradient of colours.
public static BackgroundBrush ( Primitive brush ) : void
brush Primitive /// A previously created gradient or image brush (LDShapes.BrushGradient LDShapes.BrushImage). ///
Результат void

BackgroundImage() публичный статический Метод

Set the background as an image. The backgound is auto rescaled to fill whatever size the GraphicsWindow is.
public static BackgroundImage ( Primitive imageName ) : void
imageName Primitive /// The image to load as the background. /// Value returned from ImageList.LoadImage or local or network image file. ///
Результат void

Capture() публичный статический Метод

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.
public static Capture ( Primitive fileName, Primitive border ) : Primitive
fileName Primitive /// 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 Primitive /// Include the window border ("True" or "False"). ///
Результат Primitive

ExitButtonMode() публичный статический Метод

Set the mode of the close button for a window.
public static ExitButtonMode ( Primitive window, Primitive mode ) : void
window Primitive The window title, e.g. TextWindow.Title or GraphicsWindow.Title.
mode Primitive The mode "Enabled", "Disabled")
Результат void

FloodFill() публичный статический Метод

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.
public static FloodFill ( Primitive x, Primitive y, Primitive colour ) : void
x Primitive /// The x co-ordinate of the pixel to start the fill. ///
y Primitive /// The y co-ordinate of the pixel to start the fill. ///
colour Primitive /// The colour to fill with. ///
Результат void

GetPixel() публичный статический Метод

Gets the color of the pixel at the specified x and y co-ordinates. This method works for background, drawing and shape layers.
public static GetPixel ( Primitive x, Primitive y ) : Primitive
x Primitive /// The x co-ordinate of the pixel. ///
y Primitive /// The y co-ordinate of the pixel. ///
Результат Primitive

PauseUpdates() публичный статический Метод

Pause GraphicsWindow Updates.
public static PauseUpdates ( ) : void
Результат void

Print() публичный статический Метод

Print the GraphicsWindow contents. The window must be visible and a short delay may be required after updating the window before calling.
public static Print ( Primitive border ) : void
border Primitive /// Include the window border ("True" or "False"). ///
Результат void

Reposition() публичный статический Метод

Scale and move all Shapes and Contols 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.
public static Reposition ( Primitive scaleX, Primitive scaleY, Primitive panX, Primitive panY, Primitive angle ) : void
scaleX Primitive The X direction scaling of the view.
scaleY Primitive The Y direction scaling of the view.
panX Primitive Pan the view in the X direction in the view scaling, 0 is centered in the GraphicsWindow.
panY Primitive Pan the view in the Y direction in the view scaling, 0 is centered in the GraphicsWindow.
angle Primitive An angle to rotate the view.
Результат void

RepositionPoint() публичный статический Метод

Get coordinates transformed between GraphicsWindow and a repositioned View (See Reposition).
public static RepositionPoint ( Primitive x, Primitive y, Primitive toGW ) : Primitive
x Primitive The x coordinate to transform.
y Primitive The x coordinate to transform.
toGW Primitive Transfer from View to GraphicsWindow ("True") or from GraphicsWindow to View ("False").
Результат Primitive

ResumeUpdates() публичный статический Метод

Resume GraphicsWindow Updates.
public static ResumeUpdates ( ) : void
Результат void

SetActive() публичный статический Метод

Set the GraphicsWindow as active (has focus).
public static SetActive ( ) : void
Результат void

SetFontFromFile() публичный статический Метод

Set font in GraphicsWindow from a local TTF font file.
public static SetFontFromFile ( Primitive fontFile ) : Primitive
fontFile Primitive Full path to font file to set.
Результат Primitive

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).
public static TransparentGW ( ) : void
Результат void

Описание свойств

_ClosingDelegate публичное статическое свойство

public static SmallBasicCallback _ClosingDelegate
Результат SmallBasicCallback