MainForm.cs ( File view )

Description:A s...
  • By vaselly 2014-09-16
  • View(s):40
  • Download(s):0
  • Point(s): 1
			// Motion Detector
//
// Copyright  Andrew Kirillov, 2005
// andrew.kirillov@gmail.com
//

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using VideoSource;
using Tiger.Video.VFW;

namespace motion
{

    /// 
    /// Summary description for MainForm
    /// 
    public class MainForm : System.Windows.Forms.Form
    {

        // statistics
        private const int statLength = 15;
        private int statIndex = 0, statReady = 0;
        private int[] statCount = new int[statLength];
        private System.Windows.Forms.NotifyIcon notifyIcon1;
        private System.Windows.Forms.ContextMenu contextMenu1;
        private System.Windows.Forms.MenuItem menuItem1;
        private IMotionDetector detector = new MotionDetector3Optimized( );
        private int detectorType = 4;
        private int intervalsToSave = 0;

        private AVIWriter writer = null;
        private bool saveOnMotion = false;

        private System.Windows.Forms.MenuItem fileItem;
        private System.Windows.Forms.MenuItem openFileItem;
        private System.Windows.Forms.MenuItem TrayIco;
        private System.Windows.Forms.MenuItem exitFileItem;
        private System.Windows.Forms.OpenFileDialog ofd;
        private System.Windows.Forms.MainMenu mainMenu;
        private System.Timers.Timer timer;
        private System.Windows.Forms.StatusBar statusBar;
        private System.Windows.Forms.StatusBarPanel fpsPanel;
        private System.Windows.Forms.Panel panel;
        private motion.CameraWindow cameraWindow;
        private System.Windows.Forms.MenuItem motionItem;
        private System.Windows.Forms.MenuItem openURLFileItem;
        private System.Windows.Forms.MenuItem openLocalFileItem;
        private System.Windows.Forms.MenuItem openMJEPGFileItem;
        private System.Windows.Forms.MenuItem helpItem;
        private System.Windows.Forms.MenuItem aboutHelpItem;
        private IContainer components;
        
        public int threshold = 220;
        private MenuItem menuItem2;
        public Label label1;
        private TextBox textBox1;
        private MenuItem menuItem3;
        public bool pptControl = true;
        public MainForm( )
        {

            
            InitializeComponent( );

            
         
           

           
        
}

        /// 
        /// Clean up any resources being used.
        /// 
        protected override void Dispose( bool disposing )
        {

            if ( disposing )
            {

                if ( components != null )
                {

                    components.Dispose( );
                
}
            
}
            base.Dispose( disposing );
        
}

       



        #region Windows Form Designer generated code
        /// 
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// 
        private void InitializeComponent( )
        {

            this.components = new System.ComponentModel.Container();
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
            this.mainMenu = new System.Windows.Forms.MainMenu(this.components);
            this.fileItem = new System.Windows.Forms.MenuItem();
            this.openFileItem = new System.Windows.Forms.MenuItem();
            this.openURLFileItem = new System.Windows.Forms.MenuItem();
            this.openMJEPGFileItem = new System.Windows.Forms.MenuItem();
            this.openLocalFileItem = new System.Windows.Forms.MenuItem();
            this.menuItem1 = new System.Windows.Forms.MenuItem();
            this.exitFileItem = new System.Windows.Forms.MenuItem();
            this.motionItem = new System.Windows.Forms.MenuItem();
            this.menuItem3 = new System.Windows.Forms.MenuItem();
            this.helpItem = new System.Windows.Forms.MenuItem();
            this.aboutHelpItem = new System.Windows.Forms.MenuItem();
            this.menuItem2 = new System.Windows.Forms.MenuItem();
            this.ofd = new System.Windows.Forms.OpenFileDialog();
            this.timer = new System.Timers.Timer();
            this.statusBar = new System.Windows.Forms.StatusBar();
            this.fpsPanel = new System.Windows.Forms.StatusBarPanel();
            this.panel = new System.Windows.Forms.Panel();
            this.label1 = new System.Windows.Forms.Label();
            this.textBox1 = new System.Windows.Forms.TextBox();
            this.cameraWindow = new motion.CameraWindow();
            ((System.ComponentModel.ISupportInitialize)(this.timer)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.fpsPanel)).BeginInit();
            this.panel.SuspendLayout();
            this.SuspendLayout();
            // 
            // mainMenu
            // 
            this.mainMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {

            this.fileItem,
            this.motionItem,
            this.helpItem
});
            // 
            // fileItem
            // 
            this.fileItem.Index = 0;
            this.fileItem.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {

            this.openFileItem,
            this.openURLFileItem,
            this.openMJEPGFileItem,
            this.openLocalFileItem,
            this.menuItem1,
            this.exitFileItem
});
            this.fileItem.Text = "&File";
            // 
            // openFileItem
            // 
            this.openFileItem.Index = 0;
            this.openFileItem.Shortcut = System.Windows.Forms.Shortcut.CtrlO;
            this.openFileItem.Text = "&Open";
            this.openFileItem.Click += new System.EventHandler(this.openFileItem_Click);
            // 
            // openURLFileItem
            // 
            this.openURLFileItem.Index = 1;
            this.openURLFileItem.Text = "Open JPEG &URL";
            this.openURLFileItem.Click += new System.EventHandler(this.openURLFileItem_Click);
            // 
            // openMJEPGFileItem
            // 
            this.openMJEPGFileItem.Index = 2;
            this.openMJEPGFileItem.Text = "Open M&JPEG URL";
            this.openMJEPGFileItem.Click += new System.EventHandler(this.openMJEPGFileItem_Click);
            // 
            // openLocalFileItem
            // 
            this.openLocalFileItem.Index = 3;
            this.openLocalFileItem.Text = "Open &Local Device";
            this.openLocalFileItem.Click += new System.EventHandler(this.openLocalFileItem_Click);
            // 
            // menuItem1
            // 
            this.menuItem1.Index = 4;
            this.menuItem1.Text = "-";
            // 
            // exitFileItem
            // 
            this.exitFileItem.Index = 5;
            this.exitFileItem.Text = "E&xit";
            this.exitFileItem.Click += new System.EventHandler(this.exitFileItem_Click);
            // 
            // motionItem
            // 
            this.motionItem.Index = 1;
            this.motionItem.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {

            this.menuItem3
});
            this.motionItem.Text = "PPT";
            // 
            // menuItem3
            // 
            this.menuItem3.Index = 0;
            this.menuItem3.Text = "PowerPoint";
            this.menuItem3.Click += new System.EventHandler(this.menuItem3_Click);
            // 
            // helpItem
            // 
            this.helpItem.Index = 2;
            this.helpItem.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {

            this.aboutHelpItem
});
            this.helpItem.Text = "&Help";
            // 
            // aboutHelpItem
            // 
            this.aboutHelpItem.Index = 0;
            this.aboutHelpItem.Text = "&About";
            this.aboutHelpItem.Click += new System.EventHandler(this.aboutHelpItem_Click);
            // 
            // menuItem2
            // 
            this.menuItem2.Index = -1;
            this.menuItem2.Text = "PowerPointControl";
            this.menuItem2.Click += new System.EventHandler(this.menuItem2_Click);
            // 
            // ofd
            // 
            this.ofd.Filter = "AVI files (*.avi)|*.avi";
            this.ofd.Title = "Open movie";
            // 
            // timer
            // 
            this.timer.Interval = 1000;
            this.timer.SynchronizingObject = this;
            this.timer.Elapsed += new System.Timers.ElapsedEventHandler(this.timer_Elapsed);
            // 
            // statusBar
            // 
            this.statusBar.Location = new System.Drawing.Point(0, 321);
            this.statusBar.Name = "statusBar";
            this.statusBar.Panels.AddRange(new System.Windows.Forms.StatusBarPanel[] {

            this.fpsPanel
});
            this.statusBar.ShowPanels = true;
            this.statusBar.Size = new System.Drawing.Size(419, 22);
            this.statusBar.TabIndex = 1;
            // 
            // fpsPanel
            // 
            this.fpsPanel.AutoSize = System.Windows.Forms.StatusBarPanelAutoSize.Spring;
            this.fpsPanel.Name = "fpsPanel";
            this.fpsPanel.Width = 402;
            // 
            // panel
            // 
            this.panel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
            this.panel.Controls.Add(this.label1);
            this.panel.Controls.Add(this.textBox1);
            this.panel.Controls.Add(this.cameraWindow);
            this.panel.Dock = System.Windows.Forms.DockStyle.Fill;
            this.panel.Location = new System.Drawing.Point(0, 0);
            this.panel.Name = "panel";
            this.panel.Size = new System.Drawing.Size(419, 321);
            this.panel.TabIndex = 2;
            this.panel.Paint += new System.Windows.Forms.PaintEventHandler(this.panel_Paint)
...
...
(Not finished, please download and read the complete file)
			
...
Expand> <Close

Want complete source code? Download it here

Point(s): 1

Download
0 lines left, continue to read
Sponsored links

File list

Tips: You can preview the content of files by clicking file names^_^
Name Size Date
01.96 kB
01.96 kB
AssemblyInfo.cs2.37 kB2006-04-11 11:57
01.96 kB
01.96 kB
dshow.dll32.00 kB2007-06-13 21:51
dshow.pdb25.50 kB2007-06-13 21:51
01.96 kB
dshow.dll32.00 kB2007-06-07 20:26
01.96 kB
1.txt45.00 B2006-04-11 11:57
IBaseFilter.cs2.14 kB2006-04-11 11:57
IBasicVideo.cs4.70 kB2006-04-11 11:57
ICreateDevEnum.cs592.00 B2006-04-11 11:57
IEnumPins.cs831.00 B2006-04-11 11:57
IFileSourceFilter.cs861.00 B2006-04-11 11:57
IFilterGraph.cs1.58 kB2006-04-11 11:57
IGraphBuilder.cs2.84 kB2006-04-11 11:57
IMediaControl.cs1.49 kB2006-04-11 11:57
IMediaEvent.cs3.06 kB2006-04-11 11:57
IMediaPosition.cs1.88 kB2006-04-11 11:57
IMediaSeeking.cs2.79 kB2006-04-11 11:57
IPin.cs2.36 kB2006-04-11 11:57
IPropertyBag.cs853.00 B2006-04-11 11:57
ISampleGrabber.cs2.21 kB2006-04-11 11:57
IVideoFrameStep.cs747.00 B2006-04-11 11:57
IVideoWindow.cs5.90 kB2006-04-11 11:57
Structures.cs4.37 kB2006-04-11 11:57
Uuids.cs4.87 kB2006-04-11 11:57
Win32.cs919.00 B2006-04-11 11:57
dshow.csproj5.38 kB2007-03-16 20:38
Filter.cs2.57 kB2006-04-11 11:57
FilterCollection.cs2.14 kB2006-04-11 11:57
01.96 kB
01.96 kB
dshow.dll32.00 kB2007-06-13 21:51
dshow.pdb25.50 kB2007-06-13 21:51
01.96 kB
dshow.csproj.FileList.txt216.00 B2007-06-15 15:17
01.96 kB
dshow.dll32.00 kB2007-06-07 20:26
01.96 kB
dshow.dll28.00 kB2007-06-07 18:09
01.96 kB
Tools.cs1.11 kB2006-04-11 11:57
motion.sln1.79 kB2007-03-16 20:38
motion.suo35.00 kB2007-06-15 15:08
01.96 kB
AboutForm.cs11.91 kB2007-06-15 15:17
AboutForm.resx9.77 kB2007-06-15 15:17
App.ico26.07 kB2006-04-11 11:57
AssemblyInfo.cs2.47 kB2007-03-20 08:40
01.96 kB
01.96 kB
AForge.dll20.00 kB2007-03-16 19:54
AForge.Imaging.dll108.00 kB2007-03-19 18:42
AForge.Math.dll28.00 kB2007-03-16 19:54
App.ico26.07 kB2006-04-11 11:57
dshow.dll32.00 kB2007-06-13 21:51
dshow.pdb25.50 kB2007-06-13 21:51
motion.exe132.00 kB2007-06-15 15:17
motion.exe.config147.00 B2007-03-19 09:20
motion.pdb181.50 kB2007-06-15 15:17
motion.vshost.exe5.50 kB2005-09-23 07:56
motion.vshost.exe.config147.00 B2007-03-19 09:20
Tiger.Video.VFW.dll24.00 kB2007-06-13 21:51
Tiger.Video.VFW.pdb27.50 kB2007-06-13 21:51
01.96 kB
AForge.dll20.00 kB2007-03-16 19:54
AForge.Imaging.dll108.00 kB2007-03-19 18:42
AForge.Math.dll28.00 kB2007-03-16 19:54
dshow.dll32.00 kB2007-06-07 20:26
motion.exe124.00 kB2007-06-07 20:40
motion.exe.config147.00 B2007-03-19 09:20
motion.vshost.exe5.50 kB2005-09-23 07:56
motion.vshost.exe.config147.00 B2007-03-19 09:20
Tiger.Video.VFW.dll24.00 kB2007-06-07 20:26
Camera.cs3.47 kB2006-04-11 11:57
CameraWindow.cs5.17 kB2006-04-11 11:57
CameraWindow.resx5.55 kB2006-04-11 11:57
CaptureDeviceForm.cs4.49 kB2007-06-15 15:17
CaptureDeviceForm.resx5.37 kB2006-04-11 11:57
ClassDiagram1.cd1.00 B2007-06-07 18:39
Copyright.txt913.00 B2007-06-15 15:17
IMotionDetector.cs785.00 B2007-06-07 20:36
MainForm.cs21.34 kB2007-06-13 21:54
MainForm.resx45.81 kB2007-06-13 21:51
motion.csproj7.33 kB2007-06-07 18:45
MotionDetector1.cs9.95 kB2007-06-07 20:37
MotionDetector2.cs4.44 kB2007-06-07 20:38
MotionDetector3.cs5.06 kB2007-06-07 20:38
MotionDetector3Optimized.cs6.57 kB2007-06-07 20:38
MotionDetector4.cs4.89 kB2007-06-07 20:38
01.96 kB
01.96 kB
motion.AboutForm.resources3.00 kB2007-06-15 15:17
motion.CameraWindow.resources581.00 B2007-06-13 21:51
motion.CaptureDeviceForm.resources279.00 B2007-06-13 21:51
motion.csproj.GenerateResource.Cache1.00 kB2007-06-15 15:17
motion.exe132.00 kB2007-06-15 15:17
motion.MainForm.resources26.62 kB2007-06-13 21:51
motion.pdb181.50 kB2007-06-15 15:17
motion.Resources.1.gif828.00 B2006-04-11 11:57
motion.Resources.2.gif822.00 B2006-04-11 11:57
motion.Resources.3.gif830.00 B2006-04-11 11:57
motion.Resources.4.gif822.00 B2006-04-11 11:57
motion.Resources.5.gif822.00 B2006-04-11 11:57
motion.Resources.6.gif830.00 B2006-04-11 11:57
motion.Resources.7.gif821.00 B2006-04-11 11:57
motion.Resources.8.gif822.00 B2006-04-11 11:57
motion.Resources.9.gif822.00 B2006-04-11 11:57
motion.URLForm.resources269.00 B2007-06-13 21:51
ResolveAssemblyReference.cache13.42 kB2007-06-15 14:58
01.96 kB
motion.csproj.FileList.txt1.64 kB2007-06-15 15:17
01.96 kB
motion.AboutForm.resources3.00 kB2007-06-07 20:26
motion.CameraWindow.resources581.00 B2007-06-07 20:26
motion.CaptureDeviceForm.resources279.00 B2007-06-07 20:26
motion.csproj.GenerateResource.Cache1.00 kB2007-06-07 20:27
motion.exe124.00 kB2007-06-07 20:40
motion.MainForm.resources26.62 kB2007-06-07 20:27
motion.Resources.1.gif828.00 B2006-04-11 11:57
motion.Resources.2.gif822.00 B2006-04-11 11:57
motion.Resources.3.gif830.00 B2006-04-11 11:57
motion.Resources.4.gif822.00 B2006-04-11 11:57
motion.Resources.5.gif822.00 B2006-04-11 11:57
motion.Resources.6.gif830.00 B2006-04-11 11:57
motion.Resources.7.gif821.00 B2006-04-11 11:57
motion.Resources.8.gif822.00 B2006-04-11 11:57
motion.Resources.9.gif822.00 B2006-04-11 11:57
motion.URLForm.resources269.00 B2007-06-07 20:26
01.96 kB
ResolveAssemblyReference.cache10.44 kB2007-06-07 20:26
01.96 kB
01.96 kB
1.gif828.00 B2006-04-11 11:57
2.gif822.00 B2006-04-11 11:57
3.gif830.00 B2006-04-11 11:57
4.gif822.00 B2006-04-11 11:57
5.gif822.00 B2006-04-11 11:57
6.gif830.00 B2006-04-11 11:57
7.gif821.00 B2006-04-11 11:57
8.gif822.00 B2006-04-11 11:57
9.gif822.00 B2006-04-11 11:57
UnsafeBitmap.cs2.76 kB2007-06-15 14:58
URLForm.cs3.98 kB2006-04-11 11:57
URLForm.resx5.36 kB2006-04-11 11:57
01.96 kB
ByteArrayUtils.cs1.25 kB2006-04-11 11:57
CameraEvents.cs626.00 B2006-04-11 11:57
CaptureDevice.cs8.15 kB2006-04-11 11:57
IVideoSource.cs1.57 kB2006-04-11 11:57
JPEGStream.cs6.89 kB2006-04-11 11:57
MJPEGStream.cs9.12 kB2006-04-11 11:57
VideoFileSource.cs3.45 kB2006-04-11 11:57
VideoStream.cs8.47 kB2006-04-11 11:57
01.96 kB
AForge.dll20.00 kB2007-03-16 19:54
AForge.Imaging.dll108.00 kB2007-03-19 18:42
AForge.Math.dll28.00 kB2007-03-16 19:54
01.96 kB
AssemblyInfo.cs2.37 kB2006-04-11 11:57
AVIReader.cs5.29 kB2006-04-11 11:57
AVIWriter.cs5.59 kB2006-04-11 11:57
01.96 kB
01.96 kB
Tiger.Video.VFW.dll24.00 kB2007-06-13 21:51
Tiger.Video.VFW.pdb27.50 kB2007-06-13 21:51
01.96 kB
Tiger.Video.VFW.dll24.00 kB2007-06-07 20:26
01.96 kB
01.96 kB
01.96 kB
Tiger.Video.VFW.dll24.00 kB2007-06-13 21:51
Tiger.Video.VFW.pdb27.50 kB2007-06-13 21:51
01.96 kB
01.96 kB
Tiger.Video.VFW.dll20.00 kB2007-06-07 18:09
01.96 kB
Tiger.Video.VFW.dll24.00 kB2007-06-07 20:26
vfw.csproj.FileList.txt276.00 B2007-06-15 15:17
vfw.csproj3.55 kB2007-03-16 20:38
Win32.cs9.81 kB2006-04-11 11:57
...
Sponsored links

MainForm.cs (805.82 kB)

Need 1 point
Your Point(s)

Your Point isn't enough.

Get point immediately by PayPal

More(Debit card / Credit card / PayPal Credit / Online Banking)

Submit your source codes. Get more point

LOGIN

Don't have an account? Register now
Need any help?
Mail to: support@codeforge.com

切换到中文版?

CodeForge Chinese Version
CodeForge English Version

Where are you going?

^_^"Oops ...

Sorry!This guy is mysterious, its blog hasn't been opened, try another, please!
OK

Warm tip!

CodeForge to FavoriteFavorite by Ctrl+D