Drag[en]gine Script Module DragonScript Script API  1.0
CaptureCanvas Class Reference

Capture canvas. More...

Inheritance diagram for CaptureCanvas:

Public Member Functions

Constructors
CaptureCanvas new ()
 Create capture canvas. More...
 
Management
Canvas getCanvas ()
 Canvas view to capture. More...
 
void setCanvas (Canvas canvasView)
 Set canvas view to capture. More...
 
Image getImage ()
 Image to capture canvas view into. More...
 
void setImage (int width, int height, int componentCount, int bitCount)
 Set image to capture canvas view into. More...
 
void dropImage ()
 Drop image if set. More...
 
bool getCapture ()
 Capture in progress. More...
 
void setCapture (bool capture)
 Set if capture is in progress. More...
 
bool equals (Object other)
 Capture canvas is equal to another object. More...
 
int hashCode ()
 Hash code for use as dictionary keys. More...
 

Detailed Description

Capture canvas.

Capture canvas allows to capture the rendering result of a canvas view into an deImage resource. Capturing is done by the graphic module during the next frame rendering. During the next GraphicSystem.renderWindows() call or at the end of the current GraphicSystem.renderWindows() call the result is stored back into the capture canvas. Whichever is the case depends on the rendering method of the graphic module. You know when the result is ready capture is set to false. The image resource is created by the caller and allows to request the result in a specific size and format. To do a successful capturing of a render view you have to do the following:

  • set image to a valid deImage object.
  • set capture to true.
  • during the next one or two GraphicSystem.renderWindows() calls check if capture is false. You can capture the canvas view of a render window or any other canvas view similar to a deCanvasCanvas.
    Author
    Roland Pl├╝ss
    Version
    1.0
    Date
    2015

Member Function Documentation

§ dropImage()

void dropImage ( )

Drop image if set.

§ equals()

bool equals ( Object  other)

Capture canvas is equal to another object.

Implements Object.equals(Object).

Returns
true if other is of type capture canvas and components are equal.

§ getCanvas()

Canvas getCanvas ( )

Canvas view to capture.

§ getCapture()

bool getCapture ( )

Capture in progress.

§ getImage()

Image getImage ( )

Image to capture canvas view into.

§ hashCode()

int hashCode ( )

Hash code for use as dictionary keys.

Implements Object.hashCode().

§ new()

CaptureCanvas new ( )

Create capture canvas.

§ setCanvas()

void setCanvas ( Canvas  canvasView)

Set canvas view to capture.

Exceptions
EInvalidParamcanvasView is not of type Canvas.VIEW.

§ setCapture()

void setCapture ( bool  capture)

Set if capture is in progress.

§ setImage()

void setImage ( int  width,
int  height,
int  componentCount,
int  bitCount 
)

Set image to capture canvas view into.

Creates a new image with the requested parameters.

Exceptions
EInvalidParamwidth is less than 1.
EInvalidParamheight is less than 1.
EInvalidParamcomponentCount is not 1, 2, 3 or 4.
EInvalidParambitCount is not 8 or 24.

The documentation for this class was generated from the following file: