From a3a6777f571745d4a13cb7a7e2f73c0b126f56b1 Mon Sep 17 00:00:00 2001 From: ztyyLV <97287824+ztyyLV@users.noreply.github.com> Date: Tue, 14 Feb 2023 18:13:01 +0800 Subject: [PATCH] Update Addon_Webcam.md --- info/api/Addon_Webcam.md | 259 ++++++++++++++++++++++----------------- 1 file changed, 145 insertions(+), 114 deletions(-) diff --git a/info/api/Addon_Webcam.md b/info/api/Addon_Webcam.md index 3feea76a..018a10c3 100644 --- a/info/api/Addon_Webcam.md +++ b/info/api/Addon_Webcam.md @@ -25,26 +25,27 @@ permalink: /info/api/Addon_Webcam.html ## CaptureImage +Capture an image from the current camera. + **Syntax** ```typescript -/** - * Capture an image from the current camera. - * @param successCallback A callback function that is executed if the request succeeds. - * @param failureCallback A callback function that is executed if the request fails. - * @argument errorCode The error code. - * @argument errorString The error String - */ CaptureImage( successCallback: () => void, - failureCallback: ( - errorCode: number, - errorString: string - ) => void + failureCallback: (errorCode: number, errorString: string) => void ): void; ``` +**Parameters** + +`successCallback`: A callback function that is executed if the request succeeds. + +`failureCallback`: A callback function that is executed if the request fails. +- `errorCode`: The error code. +- `errorString`: The error String + **Availability** +
@@ -71,16 +72,16 @@ CaptureImage( ## GetSourceList +Return a list of all available cameras. + **Syntax** ```typescript -/** - * Return a list of all available cameras. - */ GetSourceList(): string[]; ``` **Availability** +
@@ -107,17 +108,20 @@ GetSourceList(): string[]; ## SelectSource +Select a camera to use. + **Syntax** ```typescript -/** - * Select a camera to use. - * @param name Specify the camera. - */ SelectSource(name: string): boolean; ``` +**Parameters** + +`name`: Specify the camera. + **Availability** +
@@ -144,12 +148,11 @@ SelectSource(name: string): boolean; ## CloseSource +Close the current camera. + **Syntax** ```typescript -/** - * Close the current camera. - */ CloseSource(): boolean; ``` @@ -158,6 +161,7 @@ CloseSource(): boolean; When you close the camera, the video stream will stop at the last frame. **Availability** +
@@ -184,15 +188,11 @@ When you close the camera, the video stream will stop at the last frame. ## PlayVideo +Start to play the video stream from the current camera. + **Syntax** ```typescript -/** - * Start to play the video stream from the current camera. - * @param DWObject Specify a WebTwain instance to show the video. - * @param quality Specify the quality of the video. - * @param frameDidShow A callback function that is triggered after each video frame is shown. - */ PlayVideo( DWObject: WebTwain, quality: number, @@ -200,7 +200,16 @@ PlayVideo( ): boolean; ``` +**Parameters** + +`DWObject`: Specify a WebTwain instance to show the video. + +`quality`: Specify the quality of the video. + +`frameDidShow`: A callback function that is triggered after each video frame is shown. + **Availability** +
@@ -227,16 +236,16 @@ PlayVideo( ## PauseVideo +Pause the video. + **Syntax** ```typescript -/** - * Pause the video. - */ PauseVideo(): boolean; ``` **Availability** +
@@ -263,22 +272,16 @@ PauseVideo(): boolean; ## StopVideo +Stop the video. + **Syntax** ```typescript -/** - * Stop the video. - */ StopVideo(): boolean; ``` -**Usage notes** - -When you capture a frame, it's always the actual latest frame from the camera even if you have paused the video. - -When you close the camera, the video stream will stop at the last frame. - **Availability** +
@@ -301,17 +304,21 @@ When you close the camera, the video stream will stop at the last frame.
+**Usage notes** + +When you capture a frame, it's always the actual latest frame from the camera even if you have paused the video. + +When you close the camera, the video stream will stop at the last frame. + --- ## GetCameraControlPropertySetting +Return information about the specified camera property. + **Syntax** ```typescript -/** - * Return information about the specified camera property. - * @param property Specify the property. - */ GetCameraControlPropertySetting( property: Dynamsoft.DWT.EnumDWT_CameraControlProperty | number ): CameraControlProperty; @@ -328,7 +335,12 @@ interface CameraControlProperty { } ``` +**Parameters** + +`property`: Specify the property. Please refer to [EnumDWT_CameraControlProperty]({{site.info}}api/Dynamsoft_Enum.html#dynamsoftdwtenumdwt_cameracontrolproperty). + **Availability** +
@@ -355,13 +367,11 @@ interface CameraControlProperty { ## GetCameraControlPropertyMoreSetting +Return detailed information about the specified camera property. + **Syntax** ```typescript -/** - * Return detailed information about the specified camera property. - * @param property Specify the property. - */ GetCameraControlPropertyMoreSetting( property: Dynamsoft.DWT.EnumDWT_CameraControlProperty | number ): CameraControlPropertyExtra; @@ -390,7 +400,12 @@ interface CameraControlPropertyExtra { } ``` +**Parameters** + +`property`: Specify the property. Please refer to [EnumDWT_CameraControlProperty]({{site.info}}api/Dynamsoft_Enum.html#dynamsoftdwtenumdwt_cameracontrolproperty). + **Availability** +
@@ -417,15 +432,11 @@ interface CameraControlPropertyExtra { ## SetCameraControlPropertySetting +Set the specified camera property. + **Syntax** ```typescript -/** - * Set the specified camera property. - * @param property Specify the property. - * @param value Specify the value. - * @param auto Specify whether the propery should change automatically. - */ SetCameraControlPropertySetting( property: Dynamsoft.DWT.EnumDWT_CameraControlProperty | number, value: number, @@ -433,11 +444,16 @@ SetCameraControlPropertySetting( ): boolean; ``` -**Usage notes** +**Parameters** -Check out Dynamsoft.DWT.EnumDWT_CameraControlProperty. +`property`: Specify the property. Please refer to [EnumDWT_CameraControlProperty]({{site.info}}api/Dynamsoft_Enum.html#dynamsoftdwtenumdwt_cameracontrolproperty). + +`value`: Specify the value. + +`auto`: Specify whether the propery should change automatically. **Availability** +
@@ -464,13 +480,11 @@ Check out
@@ -514,13 +533,11 @@ interface VideoControlProperty { ## GetVideoPropertyMoreSetting +Return detailed information about the specified video property. + **Syntax** ```typescript -/** - * Return detailed information about the specified video property. - * @param property Specify the property. - */ GetVideoPropertyMoreSetting( property: Dynamsoft.DWT.EnumDWT_VideoProperty | number ): VideoControlPropertyExtra; @@ -549,7 +566,12 @@ interface VideoControlPropertyExtra { } ``` +**Parameters** + +`property`: Specify the property. Please refer to [EnumDWT_VideoProperty]({{site.info}}api/Dynamsoft_Enum.html#dynamsoftdwtenumdwt_videoproperty). + **Availability** +
@@ -576,15 +598,11 @@ interface VideoControlPropertyExtra { ## SetVideoPropertySetting +Set the specified video property. + **Syntax** ```typescript -/** - * Set the specified video property. - * @param property Specify the property. - * @param value Specify the value. - * @param auto Specify whether the propery should change automatically. - */ SetVideoPropertySetting( property: Dynamsoft.DWT.EnumDWT_VideoProperty | number, value: number, @@ -592,11 +610,16 @@ SetVideoPropertySetting( ): boolean; ``` -**Usage notes** +**Parameters** -Check out Dynamsoft.DWT.EnumDWT_VideoProperty. +`property`: Specify the property. Please refer to [EnumDWT_VideoProperty]({{site.info}}api/Dynamsoft_Enum.html#dynamsoftdwtenumdwt_videoproperty). + +`value`: Specify the value. + +`auto`: Specify whether the propery should change automatically. **Availability** +
@@ -623,12 +646,11 @@ Check out
@@ -674,12 +697,11 @@ interface FrameRate { ## GetMediaType +Return the media types supported by the current camera. + **Syntax** ```typescript -/** - * Return the media types supported by the current camera. - */ GetMediaType(): MediaType; interface MediaType { @@ -699,6 +721,7 @@ interface MediaType { ``` **Availability** +
@@ -725,12 +748,11 @@ interface MediaType { ## GetResolution +Return the resolutions supported by the current camera. + **Syntax** ```typescript -/** - * Return the resolutions supported by the current camera. - */ GetResolution(): Resolution; interface Resolution { @@ -750,6 +772,7 @@ interface Resolution { ``` **Availability** +
@@ -776,17 +799,20 @@ interface Resolution { ## SetFrameRate +Set the frame rate. + **Syntax** ```typescript -/** - * Set the frame rate. - * @param rate Specify the frame rate. - */ SetFrameRate(rate: number): boolean; ``` +**Parameters** + +`rate`: Specify the frame rate. + **Availability** +
@@ -813,17 +839,20 @@ SetFrameRate(rate: number): boolean; ## SetMediaType +Set the media type. + **Syntax** ```typescript -/** - * Set the media type. - * @param type Sepcify the media type. - */ SetMediaType(type: string): boolean; ``` +**Parameters** + +`type`: Sepcify the media type. + **Availability** +
@@ -850,23 +879,20 @@ SetMediaType(type: string): boolean; ## SetResolution +Set the resolution. + **Syntax** ```typescript -/** - * Set the resolution. - * @param resolution Specify the resolution. - */ SetResolution(resolution: string): boolean; ``` -**Example** +**Parameters** -```javascript -DWObject.Addon.Webcam.SetResolution("640 x 480"); -``` +`resolution`: Specify the resolution. **Availability** +
@@ -889,27 +915,32 @@ DWObject.Addon.Webcam.SetResolution("640 x 480");
+**Example** + +```javascript +DWObject.Addon.Webcam.SetResolution("640 x 480"); +``` + --- ## SetVideoRotateMode +Rotate the video. + **Syntax** ```typescript -/** - * Rotate the video. - * @param mode Specify the rotate mode - */ SetVideoRotateMode( mode: Dynamsoft.DWT.EnumDWT_VideoRotateMode | number ): boolean; ``` -**Usage notes** +**Parameters** -Check out Dynamsoft.DWT.EnumDWT_VideoRotateMode. +`mode`: Specify the rotate mode. Please refer to [EnumDWT_VideoRotateMode]({{site.info}}api/Dynamsoft_Enum.html#dynamsoftdwtenumdwt_videorotatemode). **Availability** +
@@ -936,16 +967,16 @@ Check out
@@ -972,22 +1003,16 @@ GetFrameURL(): string; ## GetFramePartURL +Return the internal URL (dwt://) for the latest frame. + **Syntax** ```typescript -/** - * Return the internal URL (dwt://) for the latest frame. - */ GetFramePartURL(): string; ``` -**Usage notes** - -`GetFrameURL()` returns a public URL that can be used to access the frame directly by any applicatoin capable of HTTP requests that runs on the same machine. For example: 'https://127.0.0.1:18623/dwt/dwt_16000428/img?id=853407158&index=-1&width=-1&height=-1&webcam=80&t=1590481406860'. - -`GetFramePartURL()` returns an internal URL that only Dynamsoft libraries such as the Barcode Reader add-on can read. For example: `dwt://dwt_16000428/img?id=853407158&index=-1&width=-1&height=-1&webcam=80&t=1590481403659` . - **Availability** +
@@ -1009,3 +1034,9 @@ GetFramePartURL(): string;
+ +**Usage notes** + +`GetFrameURL()` returns a public URL that can be used to access the frame directly by any applicatoin capable of HTTP requests that runs on the same machine. For example: `https://127.0.0.1:18623/dwt/dwt_16000428/img?id=853407158&index=-1&width=-1&height=-1&webcam=80&t=1590481406860`. + +`GetFramePartURL()` returns an internal URL that only Dynamsoft libraries such as the Barcode Reader add-on can read. For example: `dwt://dwt_16000428/img?id=853407158&index=-1&width=-1&height=-1&webcam=80&t=1590481403659`. \ No newline at end of file