我想展示手机摄像头在 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 http://community.intermec.com/t5/General-Development-Developer/CN50-MS-Camera-Capture-Dialog-generates-error/m-p/12881#M4083
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)