Exemple #1
0
        private void btnGo_Click(object sender, EventArgs e)
        {
            double psnr;


            if (this.pbSource.Image == null)
            {
                this.btnOpenS_Click(sender, e);
            }

            if (this.pbTarget.Image == null)
            {
                this.btnOpenT_Click(sender, e);;
            }

            if ((this.pbSource.Image == null) || (this.pbTarget.Image == null))
            {
                return;
            }

            this.pbResult.Image = FusionFlip.MakeFlip(this.pbSource.Image, this.pbTarget.Image);

            this.pbResult.Image.Save(
                Path.GetFileNameWithoutExtension(this.tbPath1.Text) + "-Filpped"
                + Path.GetExtension(this.tbPath1.Text)
                , ((this.pbSource.Image.RawFormat.Guid == ImageFormat.MemoryBmp.Guid) ? ImageFormat.Bmp : this.pbSource.Image.RawFormat));

            this.tbResult.Text = ""
                                 + "Width: " + this.pbResult.Width.ToString() + "\r\n"
                                 + "Height: " + this.pbResult.Height.ToString() + "\r\n"
                                 + "Format: " + this.GetImageFormat(this.pbResult.Image);


            psnr = Quality.PSNR(this.pbSource.Image, this.pbResult.Image);
            if (psnr == double.NaN)
            {
                this.tbResult.Text += "\r\n\r\n"
                                      + "Images are identical.";
            }
            else
            {
                this.tbResult.Text += "\r\n\r\n"
                                      + "PSNR: " + psnr.ToString("00.0000");
            }
        }
Exemple #2
0
        private void btnRevResult_Click(object sender, EventArgs e)
        {
            Image img;


            if (this.pbResult.Image == null)
            {
                return;
            }

            img = this.pbResult.Image;

            this.pbResult.Image = FusionFlip.MakeFlip(img);

            this.pbResult.Image.Save(
                Path.GetFileNameWithoutExtension(this.tbPath1.Text) + "-Filpped-Rev"
                + Path.GetExtension(this.tbPath1.Text)
                , ((img.RawFormat.Guid == ImageFormat.MemoryBmp.Guid) ? ImageFormat.Bmp : img.RawFormat));
        }