Drag[en]gine Script Module DragonScript  1.21
Dragengine.Gui.CaptureCanvas Class Reference

Capture canvas. More...

Inheritance diagram for Dragengine.Gui.CaptureCanvas:

Public Member Functions

Constructors
CaptureCanvas new ()
 Create capture canvas. More...
 
Management
CanvasView getCanvasView ()
 Canvas view to capture. More...
 
void setCanvasView (CanvasView 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.

Member Function Documentation

◆ dropImage()

void Dragengine.Gui.CaptureCanvas.dropImage ( )

Drop image if set.

◆ equals()

bool Dragengine.Gui.CaptureCanvas.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.

◆ getCanvasView()

CanvasView Dragengine.Gui.CaptureCanvas.getCanvasView ( )

Canvas view to capture.

◆ getCapture()

bool Dragengine.Gui.CaptureCanvas.getCapture ( )

Capture in progress.

◆ getImage()

Image Dragengine.Gui.CaptureCanvas.getImage ( )

Image to capture canvas view into.

◆ hashCode()

int Dragengine.Gui.CaptureCanvas.hashCode ( )

Hash code for use as dictionary keys.

Implements Object.hashCode().

◆ new()

CaptureCanvas Dragengine.Gui.CaptureCanvas.new ( )

Create capture canvas.

◆ setCanvasView()

void Dragengine.Gui.CaptureCanvas.setCanvasView ( CanvasView  canvasView)

Set canvas view to capture.

Exceptions
EInvalidParamcanvasView is not of type Canvas.VIEW.

◆ setCapture()

void Dragengine.Gui.CaptureCanvas.setCapture ( bool  capture)

Set if capture is in progress.

◆ setImage()

void Dragengine.Gui.CaptureCanvas.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: