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 :
CopyCapture capture = new Capture();
If required, you can also subscribe Finished event :
Copycapture.Finished += onCaptureFinished;
At the subcribed event handler, user can know whether capture finish succeeded state.
Copyprivate 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#Copypublic class Capture : BaseHandle, IDynamicResourceHandler, IElement, INameScope, IElementController, System.IDisposable
- Inheritance
- Implements
Constructors
Declaration
C#Copypublic Capture()
Methods
Declaration
C#Copyprotected override void Dispose(DisposeTypes type)
Parameters
Type | Name | Description |
---|---|---|
DisposeTypes | type |
Overrides
Declaration
C#Copypublic PixelBuffer GetCapturedBuffer()
Returns
Type | Description |
---|---|
PixelBuffer | PixelBuffer of captured buffer |
Declaration
C#Copypublic NativeImageSource GetNativeImageSource()
Returns
Type | Description |
---|---|
NativeImageSource | NativeImageSource that is saved captured image. |
Declaration
C#Copyprotected override void ReleaseSwigCPtr(HandleRef swigCPtr)
Parameters
Type | Name | Description |
---|---|---|
HandleRef | swigCPtr |
Declaration
C#Copypublic 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] |
Start(Container, Position, Size, String, Color)
Start capture and save the image as a file.
Declaration
C#Copypublic 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. |
Declaration
C#Copypublic 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.
Declaration
C#Copypublic 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. |
Start(Container, Size, String, Color, UInt32)
Start capture and save the image as a file.
Declaration
C#Copypublic 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
Declaration
C#Copypublic event EventHandler<CaptureFinishedEventArgs> Finished
Event Type
Type | Description |
---|---|
EventHandler<CaptureFinishedEventArgs> |