Class Capture

Definition

Namespace:
Tizen.NUI
Assembly:
Tizen.NUI.dll

Capture snapshots the current scene and save as a file. Applications should follow the example below to create capture :

Copy
Capture capture = new Capture();

If required, you can also subscribe Finished event :

Copy
capture.Finished += onCaptureFinished;

At the subcribed event handler, user can know whether capture finish succeeded state.

Copy
private void onCaptureFinished(object sender, CaptureFinishedEventArgs e) { if(e.Success) { //capture success, do something. } else { //capture failure, do something. } }

suppose that we want to capture View 'A'. And, the View 'A' is overlapped by another View 'B' that is not a child of 'A'. in this case, if source is root of scene, the captured image includes a part of View 'B' on the 'A'. however, if source is just View 'A', the result includes only 'A'.

C#
Copy
public class Capture : BaseHandle, IDynamicResourceHandler, IElement, INameScope, IElementController, System.IDisposable
Inheritance
Implements

Constructors

View Source

Capture()

Create an Capture.

Declaration
C#
Copy
public Capture()

Methods

View Source

Dispose(DisposeTypes)

Dispose

Declaration
C#
Copy
protected override void Dispose(DisposeTypes type)
Parameters
Type Name Description
DisposeTypes type
Overrides
View Source

GetCapturedBuffer()

Get Captured buffer.

Declaration
C#
Copy
public PixelBuffer GetCapturedBuffer()
Returns
Type Description
PixelBuffer

PixelBuffer of captured buffer

View Source

GetNativeImageSource()

Get NativeImageSource that is saved captured image.

Declaration
C#
Copy
public NativeImageSource GetNativeImageSource()
Returns
Type Description
NativeImageSource

NativeImageSource that is saved captured image.

View Source

ReleaseSwigCPtr(HandleRef)

Declaration
C#
Copy
protected override void ReleaseSwigCPtr(HandleRef swigCPtr)
Parameters
Type Name Description
HandleRef swigCPtr
View Source

SetImageQuality(UInt32)

Set result image quality in case of jpeg.

Declaration
C#
Copy
public void SetImageQuality(uint quality)
Parameters
Type Name Description
UInt32 quality

quality The value to control image quality for jpeg file format in the range [1, 100]

View Source

Start(Container, Position, Size, String, Color)

Start capture and save the image as a file.

Declaration
C#
Copy
public void Start(Container source, Position position, Size size, string path, Color color)
Parameters
Type Name Description
Container source

source View or Layer to be used for capture. This source must be added on the window in advance.

Position position

top-left position of area to be captured. this position is defined in the window.

Size size

captured size.

String path

image file path to be saved as a file. If path is empty string, the captured result is not be saved as a file.

Color color

background color of captured scene.

View Source

Start(Container, Size, String)

Start capture and save the image as a file.

Declaration
C#
Copy
public void Start(Container source, Size size, string path)
Parameters
Type Name Description
Container source

source View or Layer to be used for capture. This source must be added on the window in advance.

Size size

captured size.

String path

image file path to be saved as a file. If path is empty string, the captured result is not be saved as a file.

Remarks

Background color of captured scene is transparent.

View Source

Start(Container, Size, String, Color)

Start capture and save the image as a file.

Declaration
C#
Copy
public void Start(Container source, Size size, string path, Color color)
Parameters
Type Name Description
Container source

source View or Layer to be used for capture. This source must be added on the window in advance.

Size size

captured size.

String path

image file path to be saved as a file. If path is empty string, the captured result is not be saved as a file.

Color color

background color of captured scene.

View Source

Start(Container, Size, String, Color, UInt32)

Start capture and save the image as a file.

Declaration
C#
Copy
public void Start(Container source, Size size, string path, Color color, uint quality)
Parameters
Type Name Description
Container source

source View or Layer to be used for capture. This source must be added on the window in advance.

Size size

captured size.

String path

image file path to be saved as a file. If path is empty string, the captured result is not be saved as a file.

Color color

background color of captured scene.

UInt32 quality

The value to control image quality for jpeg file format in the range [1, 100].

Events

View Source

Finished

For subscribing Finished event sent by this class.

Declaration
C#
Copy
public event EventHandler<CaptureFinishedEventArgs> Finished
Event Type
Type Description
EventHandler<CaptureFinishedEventArgs>

Implements

Extension Methods