public DialogResult ShowAsDialog(FaceDetectionSettings faceDetectionSettings)
        {
            this.faceDetectionSettings = faceDetectionSettings;
            this.propertyGridFacedetectionSettings.SelectedObject = faceDetectionSettings;

            return(this.ShowDialog());
        }
        public DialogResult ShowAsDialog(FaceDetectionSettings faceDetectionSettings)
        {
            this.faceDetectionSettings = faceDetectionSettings;
            this.propertyGridFacedetectionSettings.SelectedObject = faceDetectionSettings;

            return this.ShowDialog();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// This class implements IClonable
        /// </summary>
        /// <returns>A cloned FaceDetectionSettingsObject</returns>
        public object Clone()
        {
            FaceDetectionSettings settings = new FaceDetectionSettings();

            settings.ImageScale   = this.ImageScale;
            settings.minNeighbors = this.minNeighbors;
            settings.MinSize      = new Size(this.MinSize.Width, this.MinSize.Height);

            return(settings);
        }
        private void buttonSettingsOK_Click(object sender, EventArgs e)
        {
            FaceDetectionSettings settings = (FaceDetectionSettings)propertyGridFacedetectionSettings.SelectedObject;
            this.faceDetectionSettings = settings;

            // min. scale has to be > 1
            if (this.faceDetectionSettings.ImageScale <= 1)
                this.faceDetectionSettings.ImageScale = 1.1;

            this.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.Close();
        }
        private void buttonSettingsOK_Click(object sender, EventArgs e)
        {
            FaceDetectionSettings settings = (FaceDetectionSettings)propertyGridFacedetectionSettings.SelectedObject;

            this.faceDetectionSettings = settings;

            // min. scale has to be > 1
            if (this.faceDetectionSettings.ImageScale <= 1)
            {
                this.faceDetectionSettings.ImageScale = 1.1;
            }

            this.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.Close();
        }
 public FormFaceDetectionSettings(EnumMode mode = EnumMode.Online)
 {
     InitializeComponent();
     this.faceDetectionSettings = new FaceDetectionSettings(mode);
     propertyGridFacedetectionSettings.SelectedObject = this.faceDetectionSettings;
 }
 public FormFaceDetectionSettings(EnumMode mode = EnumMode.Online)
 {
     InitializeComponent();
     this.faceDetectionSettings = new FaceDetectionSettings(mode);
     propertyGridFacedetectionSettings.SelectedObject = this.faceDetectionSettings;
 }
Ejemplo n.º 8
0
        public void TestMethod_Test_FaceDetectionSettings()
        {
            FaceDetectionSettings faceDetectionSettings = new FaceDetectionSettings();

            // enter invalid values
            faceDetectionSettings.ImageScale = 0;
            faceDetectionSettings.MinNeighbors = 0;
            faceDetectionSettings.MinSize = new Size(0, 0);

            // test the setters
            Assert.IsTrue(faceDetectionSettings.ImageScale > 0);
            Assert.IsTrue(faceDetectionSettings.MinNeighbors > 0);
            Assert.IsTrue(faceDetectionSettings.MinSize.Height > 0);
            Assert.IsTrue(faceDetectionSettings.MinSize.Width > 0);
        }
        /// <summary>
        /// This class implements IClonable
        /// </summary>
        /// <returns>A cloned FaceDetectionSettingsObject</returns>
        public object Clone()
        {
            FaceDetectionSettings settings = new FaceDetectionSettings();
            settings.ImageScale = this.ImageScale;
            settings.minNeighbors = this.minNeighbors;
            settings.MinSize = new Size(this.MinSize.Width, this.MinSize.Height);

            return settings;
        }