fork download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. Using System.Windows.Forms;
  9.  
  10. // 要引用的類別
  11. using Emgu.CV;
  12. using Emgu.CV.Structure;
  13. using Emgu.Util;
  14. using System.Threading;
  15.  
  16. namespace MyOpenCV
  17. {
  18. public partial class Form2 : Form
  19. {
  20. public Form2()
  21. {
  22. InitializeComponent();
  23. }
  24.  
  25. private Capture _capture;
  26. private bool _captureInProgress;
  27.  
  28. private void ProcessFrame(object sender, EventArgs arg)
  29. {
  30. Image<Bgr, Byte> frame = _capture.QueryFrame();
  31. captureImageBox.Image = frame;
  32. }
  33.  
  34. private void captureButton_Click(object sender, EventArgs e)
  35. {
  36. if capture is not created, create it now
  37.  
  38. if (_capture != null)
  39. {
  40. if (_captureInProgress)
  41. { //stop the capture
  42. Application.Idle -= new EventHandler(ProcessFrame);
  43. captureButton.Text = "Start Capture";
  44. }
  45. else
  46. {
  47. //start the capture
  48. captureButton.Text = "Stop";
  49. Application.Idle += new EventHandler(ProcessFrame);
  50. }
  51.  
  52. _captureInProgress = !_captureInProgress;
  53. }
  54. }
  55. }
  56. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:1: error: class, interface, or enum expected
using System;
^
Main.java:2: error: class, interface, or enum expected
using System.Collections.Generic;
^
Main.java:3: error: class, interface, or enum expected
using System.ComponentModel;
^
Main.java:4: error: class, interface, or enum expected
using System.Data;
^
Main.java:5: error: class, interface, or enum expected
using System.Drawing;
^
Main.java:6: error: class, interface, or enum expected
using System.Linq;
^
Main.java:7: error: class, interface, or enum expected
using System.Text;
^
Main.java:8: error: class, interface, or enum expected
Using System.Windows.Forms;
^
Main.java:11: error: class, interface, or enum expected
using Emgu.CV;
^
Main.java:12: error: class, interface, or enum expected
using Emgu.CV.Structure;
^
Main.java:13: error: class, interface, or enum expected
using Emgu.Util;
^
Main.java:14: error: class, interface, or enum expected
using System.Threading; 
^
Main.java:16: error: class, interface, or enum expected
namespace MyOpenCV
^
Main.java:18: error: class, interface, or enum expected
    public partial class Form2 : Form
           ^
Main.java:18: error: '{' expected
    public partial class Form2 : Form
                              ^
Main.java:36: error: '(' expected
            if capture is not created, create it now
              ^
Main.java:36: error: ')' expected
            if capture is not created, create it now
                      ^
Main.java:36: error: ';' expected
            if capture is not created, create it now
                             ^
Main.java:36: error: variable declaration not allowed here
            if capture is not created, create it now
                          ^
Main.java:36: error: not a statement
            if capture is not created, create it now
                              ^
Main.java:36: error: ';' expected
            if capture is not created, create it now
                                     ^
Main.java:36: error: ';' expected
            if capture is not created, create it now
                                                ^
Main.java:36: error: not a statement
            if capture is not created, create it now
                                                 ^
Main.java:36: error: ';' expected
            if capture is not created, create it now
                                                    ^
Main.java:56: error: class, interface, or enum expected
}
^
25 errors
stdout
Standard output is empty