Пример #1
0
        private void AddFile(string filename)
        {
            var info = new PIPInfo();

            // first file should be added as usual, other files using PIP API
            if (MediaPlayer1.FilenamesOrURL.Count == 0)
            {
                MediaPlayer1.FilenamesOrURL.Add(filename);
                lbSourceFiles.Items.Add($@"{filename} (entire screen)");
                info.Rect  = new Rectangle(0, 0, 0, 0);
                info.Alpha = 1.0f;
            }
            else
            {
                int left   = Convert.ToInt32(edPIPFileLeft.Text);
                int top    = Convert.ToInt32(edPIPFileTop.Text);
                int width  = Convert.ToInt32(edPIPFileWidth.Text);
                int height = Convert.ToInt32(edPIPFileHeight.Text);

                MediaPlayer1.PIP_Sources_Add(filename, left, top, width, height);
                lbSourceFiles.Items.Add($@"{filename} ({left}.{top}px, width: {width}px, height: {height}px)");
                info.Rect = new Rectangle(left, top, width, height);

                info.Alpha = tbStreamTransparency.Value / 100.0f;
            }

            info.Filename = filename;
            info.ZOrder   = _lastZOrder--;

            _pipInfos.Add(info);

            //lbSourceFiles.SelectedIndex = _pipInfos.Count - 1;
        }