title: Emgu CV issue with a short code
body: <p>I've been testing and searching for the help but could not resolve this issue:</p>
  
  <p>In C# and with emgu I can't run this simplest code:</p>
  
  <pre><code>... //**after these 3 dots HERE I GOT THE FIRST WARNING :a namespace cannot directly contain members such as fields or methods**
  
  //Create an image of 400x200 of Blue color
  using (Image&lt;Bgr, Byte&gt; img = new Image&lt;Bgr, byte&gt;(400, 200, new Bgr(255, 0, 0))) 
  {
     //Create the font
     MCvFont f = new MCvFont(CvEnum.FONT.CV_FONT_HERSHEY_COMPLEX, 1.0, 1.0);
  
     //Draw "Hello, world." on the image using the specific font
     img.Draw("Hello, world", ref f, new Point(10, 80), new Bgr(0, 255, 0)); 
  
     //Show the image using ImageViewer from Emgu.CV.UI
     ImageViewer.Show(img, "Test Window");
  }
  </code></pre>
  
  <p><strong>I get these errors:</strong></p>
  
  <pre><code>error CS0116: A namespace cannot directly contain members such as fields or methods
  error CS1518: Expected class, delegate, enum, interface, or struct
  </code></pre>
  
  <p><strong>PS :</strong> emgu cv has been correctly installed , in C# this code (much more complex) runs perfectly:</p>
  
  <pre><code>namespace CameraCapture
  {
      public partial class CameraCapture : Form
      {
          //declaring global variables
          private Capture capture;        //takes images from camera as image frames
          private bool captureInProgress;
  
          public CameraCapture()
          {
              InitializeComponent();
          }
          //------------------------------------------------------------------------------//
          //Process Frame() below is our user defined function in which we will create an EmguCv 
          //type image called ImageFrame. capture a frame from camera and allocate it to our 
          //ImageFrame. then show this image in ourEmguCV imageBox
          //------------------------------------------------------------------------------//
          private void ProcessFrame(object sender, EventArgs arg)
          {
              Image&lt;Bgr, Byte&gt; ImageFrame = capture.QueryFrame();
              CamImageBox.Image = ImageFrame;
          }
  
          //btnStart_Click() function is the one that handles our "Start!" button' click 
          //event. it creates a new capture object if its not created already. e.g at first time
          //starting. once the capture is created, it checks if the capture is still in progress,
          //if so the
          private void btnStart_Click(object sender, EventArgs e)
          {
              #region if capture is not created, create it now
              if (capture == null)
              {
                  try
                  {
                      capture = new Capture();
                  }
                  catch (NullReferenceException excpt)
                  {
                      MessageBox.Show(excpt.Message);
                  }
              }
              #endregion
  
              if (capture != null)
              {
                  if (captureInProgress)
                  {  //if camera is getting frames then stop the capture and set button Text
                      // "Start" for resuming capture
                      btnStart.Text = "Start!"; //
                      Application.Idle -= ProcessFrame;
                  }
                  else
                  {
                      //if camera is NOT getting frames then start the capture and set button
                      // Text to "Stop" for pausing capture
                      btnStart.Text = "Stop";
                      Application.Idle += ProcessFrame;
                  }
  
                  captureInProgress = !captureInProgress;
              }
          }
  
          private void ReleaseData()
          {
              if (capture != null)
                  capture.Dispose();
          }
  
          private void CameraCapture_Load(object sender, EventArgs e)
          {
  
          }
      }
  }
  </code></pre>
  
  <p>Thank you for the help!</p>