C# Class LitDev.LDGraphicsWindow

Afficher le fichier Open project: litdev1/LitDev

Méthodes publiques

Свойство Type Description
_ClosingDelegate SmallBasicCallback

Méthodes publiques

Méthode Description
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).

Private Methods

Méthode Description
BackgroundBrushGradient ( Primitive brush ) : void
GetTransforms ( System.Windows.Controls.Canvas canvas ) : void
_ClosingEvent ( Object sender, CancelEventArgs e ) : void

Method Details

BackgroundBrush() public static méthode

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). ///
Résultat void

BackgroundImage() public static méthode

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. ///
Résultat void

Capture() public static méthode

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"). ///
Résultat Primitive

ExitButtonMode() public static méthode

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")
Résultat void

FloodFill() public static méthode

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. ///
Résultat void

GetPixel() public static méthode

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. ///
Résultat Primitive

PauseUpdates() public static méthode

Pause GraphicsWindow Updates.
public static PauseUpdates ( ) : void
Résultat void

Print() public static méthode

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"). ///
Résultat void

Reposition() public static méthode

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.
Résultat void

RepositionPoint() public static méthode

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").
Résultat Primitive

ResumeUpdates() public static méthode

Resume GraphicsWindow Updates.
public static ResumeUpdates ( ) : void
Résultat void

SetActive() public static méthode

Set the GraphicsWindow as active (has focus).
public static SetActive ( ) : void
Résultat void

SetFontFromFile() public static méthode

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.
Résultat Primitive

TransparentGW() public static méthode

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
Résultat void

Property Details

_ClosingDelegate public_oe static_oe property

public static SmallBasicCallback _ClosingDelegate
Résultat SmallBasicCallback