Answered by:
Metro apps Camera view Zoom In and Zoom Out

Question
-
I am trying to do zoom in and zoom out of camera view by slider, but VideoDeviceController doesn't supports the zoom. i tried with VideoDeviceController.Focuse it worked perfectly. Below is My Zoom code but its not working
private Windows.Media.Capture.MediaCapture m_mediaCaptureMgr;
if ((m_mediaCaptureMgr.VideoDeviceController.Zoom!= null) && m_mediaCaptureMgr.VideoDeviceController.Zoom.Capabilities.Supported) { SetupVideoDeviceControl(m_mediaCaptureMgr.VideoDeviceController, ZoomSlider); }
public void SetupVideoDeviceControl(Windows.Media.Devices.VideoDeviceController videoDeviceControl, Slider slider) { double value = 0.0; try {
if (videoDeviceControl.Zoom.Capabilities.Step != 0)
{
slider.IsEnabled = true;
slider.Maximum = videoDeviceControl.Zoom.Capabilities.Max;
slider.Minimum = videoDeviceControl.Zoom.Capabilities.Min;
slider.StepFrequency = videoDeviceControl.Zoom.Capabilities.Step;
videoDeviceControl.Zoom.TryGetValue(out value);
slider.Value = value;
}
else
{
slider.IsEnabled = false;
}
}
catch (Exception)
{
}
}internal void ZoomSlider_ValueChanged_1(object sender, RoutedEventArgs e) { try { m_mediaCaptureMgr.VideoDeviceController.Zoom.TrySetValue(ZoomSlider.Value);
}
catch (Exception)
{
}
}- Moved by Ed Price - MSFTMicrosoft employee Saturday, June 30, 2012 12:23 AM (From:MSDN, TechNet, and Expression Profile and Recognition System Discussions)
Monday, June 25, 2012 7:02 PM
Answers
-
This forum is for questions and feedback related to the forums themselves.
I'd ask in a C# Forum.
http://social.msdn.microsoft.com/Forums/en-US/category/visualcsharp
When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer
My Blog: http://unlockpowershell.wordpress.com
My Book: Windows PowerShell 2.0 Bible
My E-mail: -join ("6B61726C6D69747363686B65406D742E6E6574"-split"(?<=\G.{2})",19|%{[char][int]"0x$_"})- Proposed as answer by Ed Price - MSFTMicrosoft employee Saturday, June 30, 2012 12:22 AM
- Marked as answer by Ed Price - MSFTMicrosoft employee Monday, July 9, 2012 4:48 PM
Monday, June 25, 2012 8:03 PM -
Hi,
the better choice would be:
http://social.msdn.microsoft.com/Forums/en-US/winappswithcsharp/threads
Oliver
- Proposed as answer by Just Karl Wednesday, June 27, 2012 1:42 PM
- Marked as answer by Ed Price - MSFTMicrosoft employee Monday, July 9, 2012 4:48 PM
Wednesday, June 27, 2012 8:44 AM
All replies
-
This forum is for questions and feedback related to the forums themselves.
I'd ask in a C# Forum.
http://social.msdn.microsoft.com/Forums/en-US/category/visualcsharp
When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer
My Blog: http://unlockpowershell.wordpress.com
My Book: Windows PowerShell 2.0 Bible
My E-mail: -join ("6B61726C6D69747363686B65406D742E6E6574"-split"(?<=\G.{2})",19|%{[char][int]"0x$_"})- Proposed as answer by Ed Price - MSFTMicrosoft employee Saturday, June 30, 2012 12:22 AM
- Marked as answer by Ed Price - MSFTMicrosoft employee Monday, July 9, 2012 4:48 PM
Monday, June 25, 2012 8:03 PM -
Hi,
the better choice would be:
http://social.msdn.microsoft.com/Forums/en-US/winappswithcsharp/threads
Oliver
- Proposed as answer by Just Karl Wednesday, June 27, 2012 1:42 PM
- Marked as answer by Ed Price - MSFTMicrosoft employee Monday, July 9, 2012 4:48 PM
Wednesday, June 27, 2012 8:44 AM -