Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Webcam Application

Webcam Application

Scheduled Pinned Locked Moved C#
graphicscsharplinqhelp
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Bishwajit Nepali
    wrote on last edited by
    #1

    I want to draw a rectangle inside webcam application and I have built the camera where should I write the code to insert ROI please help me. My 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;

    namespace Camera_app
    {
    public partial class Form1 : Form
    {
    Camera c;
    List<Bitmap> imag = new List<Bitmap>();
    public Form1()
    {
    InitializeComponent();
    c = new Camera(cbox1);

        }
    
        private void panel1\_Paint(object sender, PaintEventArgs e)
        {
    
        }
    
        private void button1\_Click(object sender, EventArgs e)
        {
            c.Connect(cbox1, pbox1);
    
        }
    
        private void button3\_Click(object sender, EventArgs e)
        {
            c.Disconnect();
        }
    
        private void button2\_Click(object sender, EventArgs e)
        {
    
            c.Capture(pbox2);
        }
    
        private void pbox2\_Click(object sender, EventArgs e)
        {
    
        }
    
        private void panel3\_Paint(object sender, PaintEventArgs e)
        {
    
        }
    
        private void panel3\_Paint\_1(object sender, PaintEventArgs e)
        {
    
        }
    
        private void pbox3\_Click(object sender, EventArgs e)
        {
    
        }
    
        private void panel5\_Paint(object sender, PaintEventArgs e)
        {
    
        }
    }
    

    }

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Threading.Tasks;
    using System.Windows.Forms;

    namespace Camera_app
    {
    static class Program
    {
    /// <summary>
    /// The main entry point for the application.
    /// </summary>
    [STAThread]
    static void Main()
    {
    Application.EnableVisualStyles();
    Application.SetCompatibleTextRenderingDefault(false);
    Application.Run(new Form1());
    }
    }
    }

    D 1 Reply Last reply
    0
    • B Bishwajit Nepali

      I want to draw a rectangle inside webcam application and I have built the camera where should I write the code to insert ROI please help me. My 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;

      namespace Camera_app
      {
      public partial class Form1 : Form
      {
      Camera c;
      List<Bitmap> imag = new List<Bitmap>();
      public Form1()
      {
      InitializeComponent();
      c = new Camera(cbox1);

          }
      
          private void panel1\_Paint(object sender, PaintEventArgs e)
          {
      
          }
      
          private void button1\_Click(object sender, EventArgs e)
          {
              c.Connect(cbox1, pbox1);
      
          }
      
          private void button3\_Click(object sender, EventArgs e)
          {
              c.Disconnect();
          }
      
          private void button2\_Click(object sender, EventArgs e)
          {
      
              c.Capture(pbox2);
          }
      
          private void pbox2\_Click(object sender, EventArgs e)
          {
      
          }
      
          private void panel3\_Paint(object sender, PaintEventArgs e)
          {
      
          }
      
          private void panel3\_Paint\_1(object sender, PaintEventArgs e)
          {
      
          }
      
          private void pbox3\_Click(object sender, EventArgs e)
          {
      
          }
      
          private void panel5\_Paint(object sender, PaintEventArgs e)
          {
      
          }
      }
      

      }

      using System;
      using System.Collections.Generic;
      using System.Linq;
      using System.Threading.Tasks;
      using System.Windows.Forms;

      namespace Camera_app
      {
      static class Program
      {
      /// <summary>
      /// The main entry point for the application.
      /// </summary>
      [STAThread]
      static void Main()
      {
      Application.EnableVisualStyles();
      Application.SetCompatibleTextRenderingDefault(false);
      Application.Run(new Form1());
      }
      }
      }

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      You're going to have to be a bit more specific. Draw a rectangle on WHAT?? The Form? On top of a control?? On top of the video??

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak

      B 1 Reply Last reply
      0
      • D Dave Kreskowiak

        You're going to have to be a bit more specific. Draw a rectangle on WHAT?? The Form? On top of a control?? On top of the video??

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak

        B Offline
        B Offline
        Bishwajit Nepali
        wrote on last edited by
        #3

        I am so sry about this . I want to draw an Roi over videosourceplayer of camera actually...

        D 1 Reply Last reply
        0
        • B Bishwajit Nepali

          I am so sry about this . I want to draw an Roi over videosourceplayer of camera actually...

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          Well, that's not going to happen in Windows Forms code. Those pixels are owned by the control that is painting the video image and anything you draw on the control will be overwritten over and over again at the frame rate your video is being drawn at. You'd have to use something like AForge.NET or OpenCVSharp to do an overlay. Google for them.

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups