如何设置Camera Capture Task WP7属性 [英] how to set Camera Capture Task WP7 properties
本文介绍了如何设置Camera Capture Task WP7属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好,我尝试构建Windows Phone 7应用程序,但在使用相机捕获图像方面没有什么问题.
Hello, i Try build application windows phone 7, but i have little problem in capture image with the camera.
private void button1_Click(object sender, RoutedEventArgs e)
{
CameraCaptureTask task = new CameraCaptureTask();
task.Completed += (s, evt) =>
{
if (evt.Error == null && evt.TaskResult == TaskResult.OK)
{
bmpImage.SetSource(evt.ChosenPhoto);
image1.Source = bmpImage;
}
};
task.Show();
}
上面的代码可以工作100%,但是我需要在捕获时固定尺寸为320 * 240像素的图像.
任何机构都知道要设置的属性吗?
this code above work 100% but I need to fix size 320*240 pixel image while capture.
any body know the properties to set it?
推荐答案
您无法使用相机任务控制任何内容..
您应该在应用程序内的画布中打开相机
这是完整的解决方案:
http://www .codeguru.com/csharp/.net/wp7/article.php/c19919/Writing-a-Windows-Phone-75-Camera-Application.htm [
you can''t control anything with the camera task..
you should open the camera in a canvas inside your app
here is a full solution :
http://www.codeguru.com/csharp/.net/wp7/article.php/c19919/Writing-a-Windows-Phone-75-Camera-Application.htm[^]
WriteableBitmap-Class是易于使用的类来调整图像大小.
http://msdn.microsoft. com/en-us/library/system.windows.media.imaging.writeablebitmap%28v = vs.95%29.aspx [
Hi,
the WriteableBitmap-Class is an easy to use class to resize images.
http://msdn.microsoft.com/en-us/library/system.windows.media.imaging.writeablebitmap%28v=vs.95%29.aspx[^]
Hope it''ll be useful for you.
With Best Regards
这篇关于如何设置Camera Capture Task WP7属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文