Beispiel #1
0
        void Completed(object sender, RunWorkerCompletedEventArgs e)
        {
            watch.Stop();
            time += watch.Elapsed;
            showTime();
            UIAssembler.HideProWin();
            Bitmap res = ContentAwareResize.DisplayImage(resizedImage);

            img.FlushBitmap(res);
            img.Flush();
        }
Beispiel #2
0
        void DoWork(object sender, DoWorkEventArgs e)
        {
            double w, h;

            w = (double)parameters["Width"].value;
            h = (double)parameters["Height"].value;
            int hf = (int)(ImageStream.CurrentImage.Height - h);
            int wf = (int)(ImageStream.CurrentImage.Width - w);

            resizedImage = ContentAwareResize.seamCarving_resize(ImageMatrix, hf, wf, (BackgroundWorker)sender);
        }
Beispiel #3
0
        public static void init()
        {
            TabControl Tb = new TabControl();

            Tb.Name = "TabManager";

            Globals.UIElements.Add(Tb.Name, Tb);
            Blur.init();
            ContentAwareResize.init();
            ImageProcOp.init();
        }
Beispiel #4
0
        protected override void instructions()
        {
            ImageMatrix = ContentAwareResize.OpenImage(ImageStream.CurrentImage.Bitmap);
            img         = ImageStream.CurrentImage;
            watch       = Stopwatch.StartNew();
            BackgroundWorker bc = new BackgroundWorker();

            bc.DoWork               += new DoWorkEventHandler(DoWork);
            bc.ProgressChanged      += new ProgressChangedEventHandler(progressChanged);
            bc.RunWorkerCompleted   += new RunWorkerCompletedEventHandler(Completed);
            bc.WorkerReportsProgress = true;

            bc.RunWorkerAsync();
            UIAssembler.ShowProWin();
            // res = ContentAwareResize.DisplayImage(resizedImage);
            //ImageStream.CurrentImage.FlushBitmap(res);
        }