locked
how to capture image while clicking the space bar in xaml

    Question

  • how to capture image while clicking the space bar in xaml
    Friday, July 13, 2012 5:14 AM

All replies

  • how we capture images while clicking space bar in a xaml in c++
    • Merged by Kee Poppy Tuesday, July 17, 2012 10:47 AM duplicate thread
    Friday, July 13, 2012 4:05 AM
  • Are you looking to capture images from a WebCam? If yes then you can refer following links

    http://easywebcam.codeplex.com/
    http://wpfcap.codeplex.com/

    Gaurav Khanna | Microsoft VB.NET MVP

    Friday, July 13, 2012 4:11 AM
  • Ya.But iam tring to capture image while clicking the space bar in c++ lang

    Friday, July 13, 2012 4:18 AM
  • Links in my previous post has code for capture image. You can add reference of any of those in your project. Then you can handle PreviewKeyDown event and call the capture image function from capture image project.

    Following is example of code in C# which you can convert into C++

            private void Window_PreviewKeyDown(object sender, KeyEventArgs e)
            {
                if (e.Key == Key.Space)
                {
                    //Call function to capture image
                }
            }


    Gaurav Khanna | Microsoft VB.NET MVP

    Friday, July 13, 2012 4:38 AM
  • Iam tried the following code but not working properly

    if (e->Key==VirtualKey::Space)

    {

    Capture();

    }

    Friday, July 13, 2012 4:59 AM
  • Hi Sarath.Satheesh s,

    Can you please explain more clearly what you are trying to do? What exactly do you mean by capture an image?

    You can use the MediaCapture class to capture a photo from the computer's camera. See the Media capture using capture device sample for an example.

    --Rob

    Friday, July 13, 2012 7:30 PM
    Owner
  • hi,

    iam tring to capture images throw camera while pressing space bar.But the default focus of the spacebar goes to a button in that grid in xaml.How this problem can be solved.The code as follows.
    if (e->Key==VirtualKey::Space)

    {

    Capture();

    }


    Monday, July 16, 2012 7:26 AM
  • WPF, SL or Metro Style?

    Kee Poppy [MSFT]
    MSDN Community Support | Feedback to us

    Monday, July 16, 2012 10:17 AM
  • metro style

    Monday, July 16, 2012 12:01 PM
  • @ sarath,

    We have Building Metro style apps with C++ forum would fit your question better. Also, I notice you have already created a new thread (http://social.msdn.microsoft.com/Forums/en-US/winappswithnativecode/thread/27bce27d-c346-4432-be0d-6944f0e74ba1/#e5b6ff94-08a7-4fbb-8d51-3e2f2192b85b) regarding this issue in that forum. So I will merge them together.

    Thanks,


    Kee Poppy [MSFT]
    MSDN Community Support | Feedback to us

    Tuesday, July 17, 2012 10:46 AM