Esempio n. 1
0
        /// <summary>
        /// Select a bitmap file as stago file
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_browseStego_Click(object sender, EventArgs e)
        {
            using (Status status = new Status(null, this.lbl_status, "Open stego file"))
            {
                try
                {
                    string path = AppUtil.SelectFile("Open stego file", "Bitmap (*.bmp)|*.bmp|AVI (*.avi)|*.avi|WAV (*.wav)|*.wav", "bmp").ToLower();

                    if (!string.IsNullOrEmpty(path))
                    {
                        this.txt_stegoObject.Text = path;

                        ///Dispose the previous processor
                        if (this._processor != null)
                        {
                            this._processor.Dispose();
                        }

                        this._processor = StegoProcessorBase.GetProcessor(path, false);
                        this._processor.LoadHost(path, true);

                        if (this._processor.MType == HostMediaType.Bitmap)
                        {
                            ///Let show the pic in preview box. Open the image by giving the path
                            ///The size mode of this image is set to zoom. So if the image is bigger then the
                            ///frame it will automatically adjust it to fit the frame. Same happens if it is smaller
                            ///then the frame
                            this.pic_stegoPreview.Image = new System.Drawing.Bitmap(this.txt_stegoObject.Text);
                        }
                        else if (this._processor.MType == HostMediaType.Wave)
                        {
                            this.pic_stegoPreview.Image = global::HideIt.Properties.Resources.wav;
                        }
                        else
                        {
                            ///setup the Avi icon image
                            this.pic_stegoPreview.Image = global::HideIt.Properties.Resources.avi;
                        }
                    }
                }
                catch (Exception exc)
                {
                    UIMessage.Error(exc.Message, TITLE);

                    if (this._processor != null)
                    {
                        try
                        {
                            this._processor.Dispose();
                        }
                        catch (Exception)
                        {
                        }
                        this._processor = null;
                    }
                }
            }
        }
Esempio n. 2
0
        private void btn_browseAvi_Click(object sender, EventArgs e)
        {
            this._srcFile        = AppUtil.SelectFile("Open video file", "AVI (*.avi)|*.avi", "avi");
            this.txtLoadAvi.Text = this._srcFile;

            try
            {
                if (this._srcFile != string.Empty)
                {
                    ///Get basic file information
                    Type      t        = Type.GetTypeFromCLSID(ComGuids.MediaDetGuid);
                    IMediaDet mediaDet = (IMediaDet)Activator.CreateInstance(t);

                    ///Set the avi file name for which we have to find information
                    mediaDet.put_Filename(this._srcFile);

                    ///Check for the current stream. If it is audio, set it up for video
                    AMMediaType mediaType = new AMMediaType();
                    mediaDet.get_StreamMediaType(mediaType);

                    ///If format type is not video
                    if (mediaType.formatType != ComGuids.VideoFormatGuid)
                    {
                        mediaDet.put_CurrentStream(1);
                        mediaDet.get_StreamMediaType(mediaType);
                    }

                    double prop = 0;
                    ///Get media length
                    mediaDet.get_StreamLength(out prop);
                    this._totalFrames = prop;

                    ///Get frame rate
                    mediaDet.get_FrameRate(out prop);
                    this._totalFrames = Math.Floor(this._totalFrames * prop);

                    AppUtil.SetupProgressBar(this.progress, 0, (int)this._totalFrames);
                }
            }
            catch (Exception exc)
            {
                UIMessage.Error(exc.Message, TITLE);
            }
        }
Esempio n. 3
0
        private void btnBrowse_Click(object sender, EventArgs e)
        {
            this.FileName = AppUtil.SelectFile("Open video file", "AVI (*.avi)|*.avi", "avi");
            if (this.FileName != string.Empty)
            {
                try
                {
                    this.CloseInterfaces();
                    this.PopulateMediaInformation();
                    this.BuildGraph();

                    ///Get file name from path
                    this.lbl_movieName.Text = Path.GetFileName(this.FileName);
                }
                catch (Exception ex)
                {
                    UIMessage.Error(ex.Message, TITLE);
                }
            }
        }
Esempio n. 4
0
        /// <summary>
        /// Select a bitmap file as cover object
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_browseCover_Click(object sender, EventArgs e)
        {
            using (Status status = new Status(null, this.lbl_status, "Open cover file"))
            {
                try
                {
                    string path = AppUtil.SelectFile("Open cover file", "Bitmap (*.bmp)|*.bmp|AVI (*.avi)|*.avi|WAV (*.wav)|*.wav", "bmp").ToLower();

                    if (!string.IsNullOrEmpty(path))
                    {
                        this.txt_coverFileName.Text = path;

                        if (this._processor != null)
                        {
                            this._processor.Dispose();
                        }

                        LoadProcessor(path);
                    }
                }
                catch (Exception exc)
                {
                    UIMessage.Error(exc.Message, TITLE);
                    if (this._processor != null)
                    {
                        try
                        {
                            this._processor.Dispose();
                        }
                        catch (Exception)
                        {
                        }
                        this._processor = null;
                    }
                }
            }
        }