none
WM5使用CameraCapturedialog报异常 RRS feed

  • 常规讨论

  • 我想用CameraCaptureDialog进行拍照,在WM5上dialog.ShowDialog();时就报异常未处理InvalidOperationExceptio【An unknown error occurred.】,但是同样的代码我考到WM6上执行,没有任何问题;请高手指教是何原因?
    private void button1_Click(object sender, EventArgs e)
    {            
                CameraCaptureDialog dialog;
               
    string AppPath = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase);
               
    string strFile = "MyTestPic.jpg";
               
    string picFolder = AppPath + @"\pic";
                dialog
    = new CameraCaptureDialog();
                dialog.StillQuality
    = CameraCaptureStillQuality.High;
                dialog.Owner
    = this;
                dialog.Resolution
    = new Size(800, 600);
                dialog.Title
    = "MyCamera";
                dialog.Mode
    = CameraCaptureMode.Still;
                dialog.InitialDirectory
    = picFolder;
                dialog.DefaultFileName
    = strFile;
                dialog.ShowDialog();
                dialog.Dispose();
    }

    2011年2月14日 6:45

全部回复