Click here to Skip to main content
15,924,036 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
// I want to captute image from camera. I want to check camera has connected
C#
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using OpenCVDotNet;

namespace WindowsApplication6
{
    public partial class Form1 : Form
    {
        private CVCapture capture;
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            capture = new CVCapture(0); // when  debug i see signal light camera
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
                using (CVImage nextFrame = capture.QueryFrame())

                {
      
                    selectPictureBox1.Image = nextFrame.ToBitmap();// this line error. Because of  nextFrame set null . may be camera not connected?
	            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            timer1.Enabled = !(timer1.Enabled);
        }
    }
}

How to fix this problem? Thanks!
Posted
Updated 2-Nov-11 1:44am
v2

1 solution

follow thw link. :)


http://support.microsoft.com/kb/283658[^]


mark as answer if solves your problem.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900