작은 테스트 카메라 응용 프로그램을 만들고 있는데 하드웨어 카메라 단추가있는 동안 포커스 텍스트 막대를 화면에 표시 할 수있는 기능을 구현하고 싶습니다. 반쯤 눌렀다. 초점 동작을 수행하기 위해 camera_ButtonHalfPress 이벤트를 만들었지 만, 그에 따라 화면에 표시하려는 텍스트 막대를 전환하는 방법을 잘 모릅니다. 본질적으로, 내 목표는 카메라 버튼을 반쯤 누른 상태에서 텍스트 막대를 표시 한 다음 버튼을 끝까지 누르면 버튼이 완전히 눌려지기 전에 버튼을 놓으면 제거됩니다. 버튼을 놓으면 나는 문제가있는 부분입니다.카메라 단추가 반쯤 눌려 졌는지 확인하는 방법
MainPage.xaml.cs를을
protected override void OnNavigatedTo(NavigationEventArgs e)
{
base.OnNavigatedTo(e);
...
//Event is fired when the button is half pressed
CameraButtons.ShutterKeyHalfPressed += camera_ButtonHalfPress;
//Event is fired when the button is fully pressed
CameraButtons.ShutterKeyPressed += camera_ButtonFullPress;
}
private void camera_ButtonHalfPress(object sender, EventArgs e)
{
//camera.Focus();
// Show the focus brackets.
focusBrackets.Visibility = Visibility.Visible;
}
}
private void camera_ButtonFullPress(object sender, EventArgs e)
{
// Hide the focus brackets.
focusBrackets.Visibility = Visibility.Collapsed;
camera.CaptureImage();
}
}
현재 사용자가 모든 방법을 누르기 전에 카메라 버튼을 해제하기로 결정하면, 초점 영역이 화면에 계속 다음과 같이 내가 가지고있는 것은 . 이 문제를 어떻게 해결할 수 있습니까?
릴리스 이벤트를 찾을 수 없습니다.이 기능이 어떻게 영향을 받는지 보여주십시오. – Matthew
그럼 ButtonFullPress 및 ButtonHalfPress 이벤트를 어떻게 등록하셨습니까? CameraButtons.ShutterKeyHalfPressed + = this.CameraButtons_ShutterKeyHalfPressed; ' –
방금 솔루션을 찾았습니다. CameraButtons 클래스에는 ShutterKeyReleased가 포함되어 있습니다. 통찰력을 가져 주셔서 감사합니다, 아래에 내 솔루션을 추가했습니다. – Matthew