public AForgeDemoForm() { InitializeComponent(); camDevices = new CameraDevices(); decodingThread = new Thread(DecodeBarcode); decodingThread.Start(); pictureBox1.Paint += pictureBox1_Paint; resultRectPen = new Pen(Color.Green, 10); }