Exemple #1
0
        public SettingsRegulation()
        {
            InitializeComponent();
            p = new PlayingThread(Program.videos.First().Key);
            pictureBox2.Image = new Bitmap(p.currentFrame);

            trackBar1.Maximum = Program.videos.First().Value.Height / 2;
            trackBar2.Maximum = Program.videos.First().Value.Height / 2;
            //trackBar1.Location = new Point(trackBar1.Location.X, pictureBox1.Location.Y + Program.videos.First().Value.Height - trackBar1.Height);

            trackBar1.Value = trackBar1.Maximum * 2 - Settings.cutBottom;
            trackBar2.Value = trackBar1.Maximum - Settings.cutTop;

            trackBar3.Value = (int)Settings.sameCharacterThreshold;

            trackBar4.Maximum = (int)Settings.sameCharacterThreshold;
            trackBar4.Value   = (int)Settings.newCharacterThreshold;

            trackBar5.Value = (int)Settings.outlineThreshold;

            trackBar6.Value  = Settings.maxCharPixelSize;
            trackBar7.Value  = Settings.minSpaceWidth;
            trackBar8.Value  = Settings.minCharPixelSize;
            trackBar9.Value  = Settings.outlineWidth;
            trackBar10.Value = Settings.lineDistance;
            trackBar11.Value = Settings.charDistance;

            colorSubtitle.Color = Settings.subColor;
            button7.BackColor   = Settings.subColor;
            colorOutline.Color  = Settings.outSubtitleColor;
            button8.BackColor   = Settings.outSubtitleColor;

            checkBox1.Checked    = Settings.ignoreTopSubtitles;
            checkBox2.Checked    = Settings.whiteAndBlack;
            checkBox3.Checked    = Settings.discardNonPassingThroughTheCenterLines;
            checkBox4.Checked    = Settings.discardNonCenteredLines;
            numericUpDown1.Value = Settings.nonCenteredThreshold;

            defaultCharScale.Text = Settings.defaultCharScale.ToString();
        }
Exemple #2
0
        void Fill(Coord p)
        {
            Queue <Coord> q = new Queue <Coord>();

            filled[p.x, p.y] = true;
            newLetter.AddPixel(p);
            q.Enqueue(p);
            while (q.Count > 0)
            {
                p = q.Dequeue();

                if (!IsFilled(p.Top) && IsValid(p.Top))
                {
                    filled[p.Top.x, p.Top.y] = true;
                    newLetter.AddPixel(p.Top);
                    q.Enqueue(p.Top);
                }
                if (!IsFilled(p.Bottom) && IsValid(p.Bottom))
                {
                    filled[p.Bottom.x, p.Bottom.y] = true;
                    newLetter.AddPixel(p.Bottom);
                    q.Enqueue(p.Bottom);
                }
                if (!IsFilled(p.Left) && IsValid(p.Left))
                {
                    filled[p.Left.x, p.Left.y] = true;
                    newLetter.AddPixel(p.Left);
                    q.Enqueue(p.Left);
                }
                if (!IsFilled(p.Right) && IsValid(p.Right))
                {
                    filled[p.Right.x, p.Right.y] = true;
                    newLetter.AddPixel(p.Right);
                    q.Enqueue(p.Right);
                }

                if (!IsFilled(p.TopLeft) && IsValid(p.TopLeft))
                {
                    filled[p.TopLeft.x, p.TopLeft.y] = true;
                    newLetter.AddPixel(p.TopLeft);
                    q.Enqueue(p.TopLeft);
                }
                if (!IsFilled(p.TopRight) && IsValid(p.TopRight))
                {
                    filled[p.TopRight.x, p.TopRight.y] = true;
                    newLetter.AddPixel(p.TopRight);
                    q.Enqueue(p.TopRight);
                }
                if (!IsFilled(p.BottomLeft) && IsValid(p.BottomLeft))
                {
                    filled[p.BottomLeft.x, p.BottomLeft.y] = true;
                    newLetter.AddPixel(p.BottomLeft);
                    q.Enqueue(p.BottomLeft);
                }
                if (!IsFilled(p.BottomRight) && IsValid(p.BottomRight))
                {
                    filled[p.BottomRight.x, p.BottomRight.y] = true;
                    newLetter.AddPixel(p.BottomRight);
                    q.Enqueue(p.BottomRight);
                }
            }
        }