Windows Mobile:使用C#的手机摄像头

Van*_*nel 8 c# camera compact-framework windows-mobile

我想在WinForm中显示手机摄像头拍摄控件的图像.我的想法是我的应用程序像摄像机程序一样工作.我想要显示图像,如果用户要拍照.

我怎样才能做到这一点?我能这样做吗?

如果您需要更多细节,请问我.

谢谢!

Adi*_*Adi 8

不太确定你需要什么,但你可以尝试使用Microsoft.WindowsMo​​bile.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;
    }
Run Code Online (Sandbox Code Playgroud)

稍后编辑: 你们中的一些人也可能会发现这个链接很有用:http: //community.intermec.com/t5/General-Development-Developer/CN50-MS-Camera-Capture-Dialog-generates-error/mp/12881# M4083