Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9170815
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:04:44+00:00 2026-06-17T16:04:44+00:00

Anybody know how to programmatically zoom the AudioVideoCaptureDevice in Windows Phone 8? I am

  • 0

Anybody know how to programmatically zoom the AudioVideoCaptureDevice in Windows Phone 8?

I am using AudioVideoCaptureDevice (and yes, I want that specific device so I can control the VideoTorchMode property). I can’t for the life of me figure out the zooming though. I am painting a Canvas using a VideoBrush mapped to the AudioVideoCaptureDevice. I’d like to implement Pinch-Zoom or even a simple +/- button to Zoom the camera.

What am I missing?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T16:04:45+00:00Added an answer on June 17, 2026 at 4:04 pm

    I’m not familiar with any API in WP8 that would allow you to programmetically set the zoom on a PhotoCaptureDevice/AudioVideoCaptureDevice. My theory is that you can do it manually by implementing your own Pinch-to-zoom functionality and making sure that region is focused.

    For information on how to Focus on a region using WP8 Camera APIs see Nokia’s Camera Explorer. The core of what you’re looking for can be found on this architectural guide under “tap-to-focus”.

    private async void videoCanvas_Tap(object sender, GestureEventArgs e)
    {
        System.Windows.Point uiTapPoint = e.GetPosition(VideoCanvas);
        if (_focusSemaphore.WaitOne(0))
        {
            // Get tap coordinates as a foundation point
            Windows.Foundation.Point tapPoint = new Windows.Foundation.Point(uiTapPoint.X, uiTapPoint.Y);
    
            double xRatio = VideoCanvas.ActualWidth / _dataContext.Device.PreviewResolution.Width;
            double yRatio = VideoCanvas.ActualHeight / _dataContext.Device.PreviewResolution.Height;
    
            // adjust to center focus on the tap point
            Windows.Foundation.Point displayOrigin = new Windows.Foundation.Point(
                tapPoint.X - _focusRegionSize.Width / 2,
                tapPoint.Y - _focusRegionSize.Height / 2);
    
            // adjust for resolution difference between preview image and the canvas
            Windows.Foundation.Point viewFinderOrigin = new Windows.Foundation.Point(displayOrigin.X / xRatio, displayOrigin.Y / yRatio);
            Windows.Foundation.Rect focusrect = new Windows.Foundation.Rect(viewFinderOrigin, _focusRegionSize);
    
            // clip to preview resolution
            Windows.Foundation.Rect viewPortRect = new Windows.Foundation.Rect(0, 0, _dataContext.Device.PreviewResolution.Width, _dataContext.Device.PreviewResolution.Height);
            focusrect.Intersect(viewPortRect);
    
            _dataContext.Device.FocusRegion = focusrect;
    
            // show a focus indicator
            FocusIndicator.SetValue(Shape.StrokeProperty, _notFocusedBrush);
            FocusIndicator.SetValue(Canvas.LeftProperty, uiTapPoint.X - _focusRegionSize.Width / 2);
            FocusIndicator.SetValue(Canvas.TopProperty, uiTapPoint.Y - _focusRegionSize.Height / 2);
            FocusIndicator.SetValue(Canvas.VisibilityProperty, Visibility.Visible);
    
            CameraFocusStatus status = await _dataContext.Device.FocusAsync();
            if (status == CameraFocusStatus.Locked)
            {
                FocusIndicator.SetValue(Shape.StrokeProperty, _focusedBrush);
                _manuallyFocused = true;
                _dataContext.Device.SetProperty(KnownCameraPhotoProperties.LockedAutoFocusParameters,
                    AutoFocusParameters.Exposure & AutoFocusParameters.Focus & AutoFocusParameters.WhiteBalance);
            }
            else
            {
                _manuallyFocused = false;
                _dataContext.Device.SetProperty(KnownCameraPhotoProperties.LockedAutoFocusParameters, AutoFocusParameters.None);
            }
            _focusSemaphore.Release();
        }
    }
    

    Here’s how to implement your own pinch-to-zoom functionality in WP8 @ Pinch To Zoom functionality in windows phone 8

    One thing I’d add to the pinch-to-zoom code sample in your case is a Clip specification on a parent control to make sure you’re not accidentally rendering images tens or hundreds of times bigger then the screen and killing your app’s performance.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anybody know how I can programmatically check (using C#) whether my program will
Anybody know of a way to batch NHibernate queries using NHibernate.Linq like you can
Anybody know of a good 3rd Party grid control that supports AutoFill (like Excel
anybody know any .Net freeware control for color selection (color dialog) that supports RGB,
Anybody know how to programmatically add an IP address to a Server 2008 Windows
Does anybody know how to programmatically disable the keyboard individual letter pop-up? (This blue
Does anybody know how to programmatically set the text of a button? thing is
Does anybody know how to generate .mht file programmatically in C#, with embedded images
anybody know how can I replace \ by \\ ? input string : Télephone
Anybody know how to get all of these in a C# app that leads

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.