Beispiel #1
0
 private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (vid != null)
     {
         audio_stop_Click(null, null);
         vid.Dispose();
         vid = null;
     }
 }//free video
Beispiel #2
0
        private void button3_Click(object sender, EventArgs e)
        {
            DialogResult D = openFileDialog1.ShowDialog();

            if (D == DialogResult.OK)
            {
                video = new Microsoft.DirectX.AudioVideoPlayback.Video(openFileDialog1.FileName);
                video.Open(openFileDialog1.FileName);
                video.Owner = panel1;
            }
        }
Beispiel #3
0
        private void InitVideo()
        {
            if (checkFileName())
            {
                try
                {
                    if (_video != null)
                    {
                        if (_cachedPath != _filePath)
                        {
                            _video.Dispose();
                            _video      = new Video(_filePath);
                            _cachedPath = _filePath;
                        }
                    }
                    else
                    {
                        _video      = new Video(_filePath);
                        _cachedPath = _filePath;
                    }

                    _video.Owner = VideoPanel;
                    isVideo      = true;
                    if (_audio != null)
                    {
                        _audio.Dispose(); _audio = null;
                    }
                }
                catch
                {
                    if (_audio != null)
                    {
                        if (_cachedPath != _filePath)
                        {
                            _audio.Dispose();
                            _video      = new Video(_filePath);
                            _cachedPath = _filePath;
                        }
                    }
                    else
                    {
                        _audio      = new Audio(_filePath);
                        _cachedPath = _filePath;
                    }
                    isVideo = false;
                    if (_video != null)
                    {
                        _video.Dispose(); _video = null;
                    }
                }
                InitEvents();
            }
        }
Beispiel #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (openAviDialog.ShowDialog() == DialogResult.OK)
            {
                int width  = panel1.Width;
                int height = panel1.Height;
                video       = new Microsoft.DirectX.AudioVideoPlayback.Video(openAviDialog.FileName);
                video.Owner = panel1;
                video.Stop();

                panel1.Size = new Size(width, height);
            }
        }
Beispiel #5
0
        private void button1_Click(object sender, EventArgs e)
        {
            if(openAviDialog.ShowDialog() == DialogResult.OK)
            {
                int width = panel1.Width;
                int height = panel1.Height;
                video = new Microsoft.DirectX.AudioVideoPlayback.Video(openAviDialog.FileName);
                video.Owner = panel1;
                video.Stop();

                panel1.Size = new Size(width,height);
            }
        }
Beispiel #6
0
        //Size VideoDefaultSize;
        public void init()
        {
            System.Drawing.Size Panel_Size;
            Panel_Size = video_panel.Size;

            OpenFileDialog of = new OpenFileDialog();

            if (of.ShowDialog() == DialogResult.OK)
            {
                if (vid != null)
                {
                    vid.Dispose();
                }
                vid              = new Microsoft.DirectX.AudioVideoPlayback.Video(of.FileName);
                vid.Owner        = this.video_panel;
                video_panel.Size = Panel_Size;
            }
        }
Beispiel #7
0
 public void PlayVideo(String nombrevideo)
 {
     if (nombrevideo == SaquePlano || nombrevideo == SaqueConEfecto)
     {
         try
         {
             Microsoft.DirectX.AudioVideoPlayback.Video video = new Microsoft.DirectX.AudioVideoPlayback.Video(nombrevideo);
             //set the System.Windows.Forms.Control to play it in (e.g a panel)
             video.Owner = this;
             //Play the video (put this in a buttons click event)
             video.Audio.Volume = 0;
             video.Play();
         }
         catch
         {
             //nothing
         }
     }
 }
        private void InitVideo()
        {
            if (checkFileName())
            {
                try
                {
                    if (_video != null)
                    {
                        if (_cachedPath != _filePath)
                        {
                            _video.Dispose();
                            _video = new Video(_filePath);
                            _cachedPath = _filePath;
                        }
                    }
                    else
                    {
                        _video = new Video(_filePath);
                        _cachedPath = _filePath;
                    }

                    _video.Owner = VideoPanel;
                    isVideo = true;
                    if (_audio != null) { _audio.Dispose(); _audio = null; }
                }
                catch
                {
                    if (_audio != null)
                    {
                        if (_cachedPath != _filePath)
                        {
                            _audio.Dispose();
                            _video = new Video(_filePath);
                            _cachedPath = _filePath;
                        }
                    }
                    else
                    {
                        _audio = new Audio(_filePath);
                        _cachedPath = _filePath;
                    }
                    isVideo = false;
                    if (_video != null) { _video.Dispose(); _video = null; }
                }
                InitEvents();
            }
        }
        public new void Dispose()
        {
            base.Dispose();
            args = null;
            _timer.Dispose();
            _timer = null;

            if (A != null)
            {
                A.Dispose();
                A = null;
            }
            if (V != null)
            {
                V.Dispose();
                V = null;
            }
            base.Dispose();
        }