Class Capture
Definition
- Assembly:
- Tizen.NUI.dll
Capture snapshots the current scene and save as a file. Applications should follow the example below to create capture :
Capture capture = new Capture();
If required, you can also subscribe Finished event :
capture.Finished += onCaptureFinished;
At the subcribed event handler, user can know whether capture finish succeeded state.
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'.
public class Capture : BaseHandle, IDynamicResourceHandler, INameScope, System.IDisposable
- Inheritance
- Implements
-
System.IDisposable
Constructors
View SourceCapture()
Create an Capture.
Declaration
public Capture()
Properties
View SourceIsExclusive
Gets or sets whether this capture source can be rendered on Screen or not. If it is true, the source is not rendered on screen but it will be captured. If it is false, the source is rendered on both of screen and captured result. Default value is false.
Declaration
public bool IsExclusive { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
View SourceDispose(DisposeTypes)
Dispose
Declaration
protected override void Dispose(DisposeTypes type)
Parameters
| Type | Name | Description |
|---|---|---|
| DisposeTypes | type |
Overrides
View SourceGetCapturedBuffer()
Get Captured buffer.
Declaration
public PixelBuffer GetCapturedBuffer()
Returns
| Type | Description |
|---|---|
| PixelBuffer | PixelBuffer of captured buffer |
GetImageUrl()
Gets ImageUrl that is saved captured image.
Declaration
public ImageUrl GetImageUrl()
Returns
| Type | Description |
|---|---|
| ImageUrl | ImageUrl that is saved captured image. |
GetNativeImageSource()
Get NativeImageSource that is saved captured image.
Declaration
public NativeImageSource GetNativeImageSource()
Returns
| Type | Description |
|---|---|
| NativeImageSource | NativeImageSource that is saved captured image. |
ReleaseSwigCPtr(HandleRef)
Declaration
protected override void ReleaseSwigCPtr(HandleRef swigCPtr)
Parameters
| Type | Name | Description |
|---|---|---|
| HandleRef | swigCPtr |
SetImageQuality(uint)
Set result image quality in case of jpeg.
Declaration
public void SetImageQuality(uint quality)
Parameters
| Type | Name | Description |
|---|---|---|
| uint | 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
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. |
Start(Container, Size, string, Color, uint)
Start capture and save the image as a file.
Declaration
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. |
| uint | quality | The value to control image quality for jpeg file format in the range [1, 100]. |
Start(Container, Size, string, Color)
Start capture and save the image as a file.
Declaration
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. |
Start(Container, Size, string)
Start capture and save the image as a file.
Declaration
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.
Events
View SourceFinished
For subscribing Finished event sent by this class.
Declaration
public event EventHandler<CaptureFinishedEventArgs> Finished
Event Type
| Type | Description |
|---|---|
| EventHandler<><CaptureFinishedEventArgs> |