How to determine if the camera button is half pressed

Posted by Matthew on Stack Overflow See other posts from Stack Overflow or by Matthew
Published on 2012-09-01T21:25:12Z Indexed on 2012/09/01 21:38 UTC
Read the original article Hit count: 147

Filed under:
|

I am creating a small test camera application, and I would like to be able to implement a feature that allows focus text bars to be present on the screen while the hardware camera button is pressed half way down. I created a camera_ButtonHalfPress event to perform the focus action, but I am unsure of how to toggle the text bars I would like to show on the screen accordingly. Essentially, my goal would be to show the text bars while the camera button is pressed half way down, and then remove them if the button is pressed all the way or the button is released before being pressed all the way down. The button being released is the part I am having trouble with. What I have is as follows:

MainPage.xaml.cs

    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();
        }
    }

Currently, if the the user decides to release the camera button before it is pressed all the way, the focus brackets persist on the screen. How might I fix this issue?

© Stack Overflow or respective owner

Related posts about c#

Related posts about windows-phone-7