diff options
Diffstat (limited to 'files/ko/web/api/imagecapture/getphotocapabilities/index.html')
-rw-r--r-- | files/ko/web/api/imagecapture/getphotocapabilities/index.html | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/files/ko/web/api/imagecapture/getphotocapabilities/index.html b/files/ko/web/api/imagecapture/getphotocapabilities/index.html new file mode 100644 index 0000000000..9ee855a96d --- /dev/null +++ b/files/ko/web/api/imagecapture/getphotocapabilities/index.html @@ -0,0 +1,79 @@ +--- +title: ImageCapture.getPhotoCapabilities() +slug: Web/API/ImageCapture/getPhotoCapabilities +tags: + - API + - Experimental + - ImageCapture + - MediaStream Image Capture API + - Method + - Reference +translation_of: Web/API/ImageCapture/getPhotoCapabilities +--- +<div>{{APIRef("MediaStream Image")}}</div> + +<p><span class="seoSummary">{{domxref("ImageCapture")}} 인터페이스의 <strong><code>getPhotoCapabilities()</code></strong> 메서드는 사용 가능한 설정 옵션을 담은 {{domxref("PhotoCapabilities")}} 객체로 이행하는 {{jsxref("Promise")}}를 반환합니다.</span></p> + +<h2 id="구문">구문</h2> + +<pre class="syntaxbox">const <em>capabilitiesPromise</em> = <em>imageCaptureObj</em>.getPhotoCapabilities()</pre> + +<h3 id="반환_값"><span style='font-family: x-locale-heading-primary,zillaslab,Palatino,"Palatino Linotype",x-locale-heading-secondary,serif; font-size: 1.375rem;'>반환 값</span></h3> + +<p>{{domxref("PhotoCapabilities")}} 객체로 이행하는 {{jsxref("Promise")}}.</p> + +<h2 id="예제">예제</h2> + +<p>다음 예제는 <a href="https://googlechrome.github.io/samples/image-capture/photo-resolution.html">Chrome의 Image Capture / Photo Resolution Sample</a>에서 가져온 코드로, <code>getPhotoCapabilities()</code>를 사용해 범위 입력 칸의 크기를 수정합니다. 또한 장치의 {{domxref("MediaStream")}}에서 가져온 {{domxref("MediaStreamTrack")}} 객체를 사용해 {{domxref("ImageCapture")}} 객체를 생성하는 부분도 포함하고 있습니다.</p> + +<pre class="brush: js">const input = document.querySelector('input[type="range"]'); + +var imageCapture; + +navigator.mediaDevices.getUserMedia({video: true}) +.then(mediaStream => { + document.querySelector('video').srcObject = mediaStream; + + const track = mediaStream.getVideoTracks()[0]; + imageCapture = new ImageCapture(track); + + return imageCapture.getPhotoCapabilities(); +}) +.then(photoCapabilities => { + const settings = imageCapture.track.getSettings(); + + input.min = photoCapabilities.imageWidth.min; + input.max = photoCapabilities.imageWidth.max; + input.step = photoCapabilities.imageWidth.step; + + return imageCapture.getPhotoSettings(); +}) +.then(photoSettings => { + input.value = photoSettings.imageWidth; +}) +.catch(error => console.log('Argh!', error.name || error));</pre> + +<h2 id="명세">명세</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">Specification</th> + <th scope="col">Status</th> + <th scope="col">Comment</th> + </tr> + <tr> + <td>{{SpecName('MediaStream Image','#dom-imagecapture-getphotocapabilities','getPhotoCapabilities()')}}</td> + <td>{{Spec2('MediaStream Image')}}</td> + <td>Initial definition.</td> + </tr> + </tbody> +</table> + +<h2 id="브라우저_호환성">브라우저 호환성</h2> + +<div> + + +<p>{{Compat("api.ImageCapture.getPhotoCapabilities")}}</p> +</div> |