我想在 WinForm 中的控件上显示手机摄像头拍摄的图像。这个想法是我的应用程序像相机程序一样工作。如果用户要拍照,我想显示图像。
我该怎么做?我可以这样做吗?
如果您需要更多详细信息,请问我。
谢谢!
最佳答案
不太确定您需要什么,但您可以尝试使用 Microsoft.WindowsMobile.Forms.CameraCaptureDialog:
string originalFileName;
using (CameraCaptureDialog dlg = new CameraCaptureDialog()) {
dlg.Mode = CameraCaptureMode.Still;
dlg.StillQuality = CameraCaptureStillQuality.Low;
//dlg.Resolution = new Size(800, 600);
dlg.Title = "Take the picture";
DialogResult res;
try {
res = dlg.ShowDialog();
}
catch (Exception ex) {
Trace.WriteLine(ex);
return null;
}
if (res != DialogResult.OK)
return null;
this.Refresh();
originalFileName = pictureFileName = dlg.FileName;
}
稍后编辑: 你们中的一些人可能也会发现此链接很有用: http://community.intermec.com/t5/General-Development-Developer/CN50-MS-Camera-Capture-Dialog-generates-error/m-p/12881#M4083
关于c# - Windows Mobile : using phone's camera with C#,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1082625/