How to programmatically zoom-in the feed from the

2019-09-06 05:36发布

问题:

I want to be able to programmatically adjust the zoom level of the camera feed.

I do not know whether cell-phone cameras have optical zoom or not and if Windows phone 7 lets a programmer control it (if it is there). If it does, please let me know how.

If it doesn't, I want to able to digitally magnify the camera feed (digital zoom). A pointer to how to do this programmatically would be great. Thanks!

回答1:

The Windows Phone 7 hardware specification does not include optical zoom. You can access the live images from the camera in Silverlight code via a CaptureSource as described in this MSDN tutorial. You can capture images via AsyncCaptureImage, which provides you with a WriteableBitmap which you can then use to zoom digitally.