Motion Detection RRS feed

  • Question

  • Does anybody know how to use trackBar to set the motion sensitivity
    level ???
    I am curently doing a motion detection project i can detect the motion and would like to show a trackBar to set the motion sensitivity.
    Hope somebody can help me..
    Thanks in advance.
    Wednesday, August 29, 2007 6:02 AM


  • Hi Hussain,


    As I understand from your description, you would like to set the motion sensitivity through a TrackBar.


    The TrackBar is a scrollable control similar to the ScrollBar control. You can configure ranges through which the value of the Value property of a track bar scrolls by setting the Minimum property to specify the lower end of the range and the Maximum property to specify the upper end of the range.


    The LargeChange property defines the increment to add or subtract from the Value property when clicks occur on either side of the scroll box. The track bar can be displayed horizontally or vertically.


    Based on my understanding, you can use this control to input numeric data such as motion sensitivity obtained in your motion detection project through the Value property.


    Here are some sample codes for your reference as follows:

            // The Maximum property sets the value of the track bar when
            // the slider is all the way to the right.
            trackBar1.Maximum = 30;

            // The TickFrequency property establishes how many positions
            // are between each tick-mark.
            trackBar1.TickFrequency = 5;

            // The LargeChange property sets how many positions to move
            // if the bar is clicked on either side of the slider.
            trackBar1.LargeChange = 3;

            // The SmallChange property sets how many positions to move
            // if the keyboard arrows are used to move the slider.
            trackBar1.SmallChange = 2;


             // Set motion sensitivity through the Value property of TrackBar

             trackBar1.Value = your motion sensitivity;


    You can check out this MSDN document about TrackBar Class for details - http://msdn2.microsoft.com/en-us/library/system.windows.forms.trackbar.aspx


    Hope this helps,


    Citizens on the earth


    Friday, August 31, 2007 1:50 AM