且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Windows Mobile:使用手机的相机与C#

更新时间:2022-01-12 22:52:27

不太确定您需要什么,但您可以尝试使用Microsoft.WindowsMo​​bile.Forms.CameraCaptureDialog:

Not very sure what you need, but you may try using 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/mp/12881#M4083