2013-08-22 3 views
0

Je travaille sur Emgu cv sur Windows 7 32 bit OS et, System.TypeInitializationException Erreur se produit, j'ai essayé toutes les solutions; Quand j'exécute les exemples avec Emgu, c'est OK, mais quand je crée mon propre projet, l'erreur se produit.Emgu System.TypeInitializationException sur Windows 32 bits 7 OS

voici mon code;

using System; 
using System.Collections.Generic; 
using System.ComponentModel; 
using System.Data; 
using System.Drawing; 
using System.Linq; 
using System.Text; 
using System.Threading.Tasks; 
using System.Windows.Forms; 
using Emgu.CV; 
using Emgu.CV.Structure; 
using Emgu.Util; 

namespace WindowsFormsApplication1 
{ 
    public partial class Form1 : Form 
     { 
     private Capture cap; 
     private bool capinpro; 

     public Form1() 
     { 
      InitializeComponent(); 
     } 


    private void processframe(object o, EventArgs e) 
    { 

     Image<Bgr, byte> img = cap.QueryFrame(); 
     imageBox1.Image = img; 
    } 



    private void button1_Click(object sender, EventArgs e) 
    { 
     if(cap!=null) 
     { 

      try 
      { 
     if (capinpro) 
     { 
      Application.Idle += processframe;  
      //i have also tried cap.start(); 
     } 
     else 
     { 
      Application.Idle -= processframe; 
     } 


      } 
      catch (Exception ex) 
      { 
       MessageBox.Show(ex.Message); 
      } 




     } 
     else 
     { 
     cap= new Capure(); 
     } 
    } 


} 

}

+0

Où/quand l'erreur se produit-elle? – joe

+0

Avez-vous inclus tous les assemblages ou juste un? –

+0

j'ai inclus toutes les références – sami

Répondre

0

bibliothèque Emgu a besoin de plus dll fichiers, donc je collé tous les dll s du dossier bin de Emgu sur le chemin de mon dossier EXE et le problème a été résolu.

Questions connexes