我正在为Windows 8开发一个应用程序,它可以从webCamera中获取照片,目前的质量(.jpg或.png)是
function takePhoto() {
//if a file with the same name exist, creates another with a number at the end
pics.createFileAsync("photo.jpg", Storage.CreationCollisionOption.generateUniqueName)
.then(function (file) {
var photoProperties = Windows.Media.MediaProperties.ImageEncodingProperties.createJpeg();
var photoProperties = Windows.Media.MediaProperties.ImageEncodingProperties.createPng();
mediaCapture.capturePhotoToStorageFileAsync(photoProperties, file).then(function () {
console.log("Image saved on disk. ");
var thumbnailUrl = URL.createObjectURL(file, { oneTimeOnly: true });
previewSlide(thumbnailUrl);
});
});
}
如果我将当前屏幕截图与原生相机的截图进行比较,原生相机的应用程序的质量是优越的,我希望得到与原生相机相同的结果,或者如果不可能,我想提高图像质量,如何实现?< / p>
提前致谢
编辑试图解析 MediaStreamType 的图片
初始化相机的功能:
function startCamera() {
mediaCapture = new Capture.MediaCapture();
mediaCapture.initializeAsync().then(function () {
var iVectorView = mediaCapture.videoDeviceController.getAvailableMediaStreamProperties(Windows.Media.Capture.MediaStreamType.photo);
for (var i = 0; i < iVectorView.length; i++) {
console.log("elemento " + i + ":" + iVectorView[i]);
}
mediaCapture.VideoDeviceController.SetMediaStreamPropertiesAsync(iVectorView[], properties);
mediaCapture.videoDeviceController.setm
livePreview.src = URL.createObjectURL(mediaCapture);
livePreview.play();
});
livePreview.addEventListener("pause", handlePause);
}
答案 0 :(得分:0)
这就是我在我的定格动画应用Zoetrope中的表现:
mediaCapture.VideoDeviceController.GetAvailableMediaStreamProperties(Windows.Media.Capture.MediaStreamType.Photo)
以获取所有可用的照片资料并将结果投放至VideoEncodingProperties
mediaCapture.VideoDeviceController.SetMediaStreamPropertiesAsync(MediaStreamType.Photo, properties) with the VideoEncodingProperties that you want to use.