问题描述
我用 MediaCapture类随身携带的Windows Phone 8.1运行时的照片。在code,我在那里拍照看起来是这样的:
I'm using MediaCapture class to take a photo with Windows Phone 8.1 Runtime. The code, where I take a picture looks like this:
// create a file
StorageFile photoFile = await ApplicationData.Current.LocalFolder.CreateFileAsync("myFirstPhoto.jpg", CreationCollisionOption.ReplaceExisting);
// take a photo with choosen Encoding
await captureManager.CapturePhotoToStorageFileAsync(ImageEncodingProperties.CreateJpeg(), photoFile);
在code工作相当精细,因为我得到的图片,但对左,右侧奇怪的条纹:
The code is working quite fine, as I get a picture, but with strange stripes on left and right side:
我试图找到这个问题的解决方案,但没有成功。我缺少的东西吗?
I'm trying to find a solution for this problem, but without success. Am I missing something?
编辑 - 从照片需要内置的应用程序是没有条纹,因此这似乎不是硬件问题
EDIT - Photos takes from build-in app are without stripes, so this seems not to be a problem with hardware.
推荐答案
好,我理解了它自己 - 它与分辨率的问题,这是使用时设置为默认值 MediaCapture
。如果你只是初始化设置后,最大分辨率 MediaCapture
那么就不会有条纹:
Ok I've figured it out myself - it's a problem with resolution which is set as default when using MediaCapture
. If you set maximum resolution just after Initializing MediaCapture
then there will be no stripes:
// just after initialization
var maxResolution = captureManager.VideoDeviceController.GetAvailableMediaStreamProperties(MediaStreamType.Photo).Aggregate(
(i1, i2) => (i1 as VideoEncodingProperties).Width > (i2 as VideoEncodingProperties).Width ? i1 : i2);
await captureManager.VideoDeviceController.SetMediaStreamPropertiesAsync(MediaStreamType.Photo, maxResolution);
这篇关于拍摄的照片有条纹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!