我已經寫了簡單的程序使用EmguCV在C#在VS 2010中打開圖像,並顯示圖像,但我得到以下異常:爲「Emgu.CV.CvInvoke」的類型初始值引發了異常
的'Emgu.CV.CvInvoke'的類型初始值設定項引發異常。
在行Image<Bgr, Byte> myimg = new Image<Bgr, Byte>(openfile.FileName);
這裏是我的代碼..
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Emgu.CV;
using Emgu.Util;
using Emgu.CV.Structure;
namespace imgdisplay2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void imageBox1_Click(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
OpenFileDialog openfile = new OpenFileDialog();
if (openfile.ShowDialog() == DialogResult.OK)
{
// imageBox1 =new Emgu.CV.UI.ImageBox() ;
Image<Bgr, Byte> myimg = new Image<Bgr, Byte>(openfile.FileName);
pictureBox1.Image = myimg.ToBitmap();
//imageBox1.Image =myimg ;
}
}
private void pictureBox1_Click(object sender, EventArgs e)
{
}
}
}
關於例外的任何細節? – Bort 2012-02-04 17:00:45
發佈InnerException,這是重要的。 – 2012-02-04 22:18:13