2016-11-22 4 views
5

카메라로 영화를 찍고 있습니다.
Google지도 확대/축소와 같은 비디오 확대/축소에 슬라이더를 사용하고 싶습니다.
다른 Question on SO을 찾았지만 제안 된 솔루션이 클릭을 위해 작동하는 반면 슬라이더 용 솔루션을 개발하고 싶습니다.
제대로 작동하지 않는 코드를 작성했습니다. 오류가 발견되지 않았지만 비디오 크기가 매우 커질 것이므로 비디오가 표시되지 않습니다.
카메라에 digitalZoom을 설정하려고하는데이 오류가 있습니다. 카메라가 확대/축소를 지원하지 않습니다.. 카메라가 "DigitalZoom"및 "OpticalZoom"을 지원하지 않는다는 것을 알고 있습니다. 카메라에서 찍은 비디오를 확대 할 수있는 방법을 찾고 싶습니다.
My camera is dino ccd.친구를 추가 할 수 없습니다.이 오류가 있습니다. "댓글을 올리는 데 50 개의 평판이 있어야합니다."확대/축소 제어를 위해 슬라이더를 연결하십시오. 카메라

VideoOutput { 
    id: viewfinder 
    source: camera 
    anchors.fill: parent 
    focus : true         
    transform: [ 
     Scale { 
      id: zoomScale 
     }, 
     Translate { 
      id: zoomTranslate 
     } 
     ] 

     //Keys.onLeftPressed: viewfinder.seek(viewfinder.position - 5000) 
     //Keys.onRightPressed: viewfinder.seek(viewfinder.position + 5000) 

     MouseArea { 
      anchors.fill: parent 
      acceptedButtons: Qt.AllButtons 
      onClicked: { 
       var zoomIn = mouse.button === Qt.LeftButton; 
       zoomScale.origin.x = mouse.x; 
       zoomScale.origin.y = mouse.y; 
      } 
     } 

     Slider { 
      id:zoomVideo 
      orientation: Qt.Vertical 
      minimumValue: 0 
      maximumValue: 100 
      stepSize: 10 

      onValueChanged: { 
       zoomScale.xScale = zoomVideo.value 
       zoomScale.yScale = zoomVideo.value 
      } 
     } 
    } 
+0

귀하의 질문은 무엇입니까? – folibis

+0

'제대로 작동하지 않는다 '는 것은 무엇을 의미합니까? 어떤 오류/예기치 않은 행동을합니까? – folibis

+0

어떤 장치를 사용하고 있습니까? 기본적으로 모든 카메라는 디지털 줌 만 지원합니다. 광학 줌이 가능한 모바일 카메라는 드뭅니다. – Unknown

답변

0

당신은 현재 내가 기계를 가지고 있지 않기 때문에, 경우는 예 다음 테스트되지 않은 코드 아래 고려 않습니다 단지 일반 모바일 카메라 응용 프로그램과 같은 슬라이더를 사용하여 줌인/​​줌아웃 기능을 구현하려고 Qt IDE가 설치되어 있지만 개념을 이해하는 데 도움이됩니다.

Camera { 
     id: camera 
     digitalZoom:zoomSlider.value 
     //if opticalZoom is supported uncomment below line 
     //opticalZoom:zoomSlider.value 

     // rest of your settings 
    } 

VideoOutput { 
    id: viewfinder 
    source: camera 
    anchors.fill: parent 
    focus : true 

    } 

    Slider { 
      id:zoomSlider 
      orientation: Qt.Vertical 
      minimumValue: 0 
      maximumValue: camera.maximumDigitalZoom //or camera.maximumOpticalZoom 
      stepSize:camera.maximumDigitalZoom/10 // going through 10 steps 
      value:1.0        // initial zoom level 
      anchors{ 
      left:parent.left 
      leftMargin:5 
      verticalCenter:parent.verticalCenter 
      } 
     } 

그리고 이러한 유형의 공식 문서를 살펴 보시기 바랍니다. Slider, Camera. 추가 설명이 필요한 경우 아래에 의견을 게시하십시오.