コード例 #1
0
        protected override void instructions()
        {
            RImage x   = (RImage)parameters["Value"].value;
            Bitmap res = ImageProcOp.AddPictures(ImageStream.CurrentImage.Bitmap, x.Bitmap);

            ImageStream.CurrentImage.FlushBitmap(res);
        }
コード例 #2
0
        public static RImage OpenImageb()
        {
            OpenFileDialog op  = new OpenFileDialog();
            DialogResult   dr  = op.ShowDialog();
            RImage         img = null;

            if (dr == DialogResult.OK)
            {
                img = new RImage(op.SafeFileName, new Uri(op.FileName));
            }
            return(img);
        }
コード例 #3
0
        public static void setCurrentImage(Image img)
        {

            for (int i = 0; i < Register.Count; i++)
            {
                foreach(RImage im in Register.ElementAt(i).Value)
                    if (im.Source == img.Source)
                    {
                        cImage = im;
                        return;
                    }
            }
        }
コード例 #4
0
 public static void setCurrentImage(Image img)
 {
     for (int i = 0; i < Register.Count; i++)
     {
         foreach (RImage im in Register.ElementAt(i).Value)
         {
             if (im.Source == img.Source)
             {
                 cImage = im;
                 return;
             }
         }
     }
 }
コード例 #5
0
 public static Coor getCoor(RImage img)
 {
     Coor res = new Coor();
     for (int i = 0; i < Register.Count; i++)
     {
         foreach (RImage im in Register.ElementAt(i).Value)
             if (img.Source == im.Source)
             {
                 res.key = Register.ElementAt(i).Key;
                 res.ix = Register.ElementAt(i).Value.IndexOf(im);
                 return res ;
             }
     }
     return new Coor();
 }
コード例 #6
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);
 }
コード例 #7
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);
        }
コード例 #8
0
        public static void addTab(RImage img)
        {
            TabItem it = new TabItem();
            it.Header = img.Name;
            Grid g = new Grid();
            Image i = new Image();
            i.Source = img.Image;
            

            g.Children.Add(i);
            it.Content = g;
            TabControl tbMan = Globals.UIElements["TabManager"] as TabControl;
            tbMan.SelectionChanged += SelectionChanged;
            tbMan.VerticalAlignment = VerticalAlignment.Stretch;
            tbMan.HorizontalAlignment = HorizontalAlignment.Stretch;
            tbMan.Items.Add(it);
            tbMan.SelectedIndex = tbMan.Items.Count - 1;
        }
コード例 #9
0
        public static Coor getCoor(RImage img)
        {
            Coor res = new Coor();

            for (int i = 0; i < Register.Count; i++)
            {
                foreach (RImage im in Register.ElementAt(i).Value)
                {
                    if (img.Source == im.Source)
                    {
                        res.key = Register.ElementAt(i).Key;
                        res.ix  = Register.ElementAt(i).Value.IndexOf(im);
                        return(res);
                    }
                }
            }
            return(new Coor());
        }
コード例 #10
0
 void OpenClick(object sender, RoutedEventArgs e)
 {
     for (int i = 0; i < UIElements.Count; i++)
     {
         Button btn = UIElements.ElementAt(i).Value[2] as Button;
         if (sender == btn)
         {
             Label     lbl = UIElements.ElementAt(i).Value[0] as Label;
             string    key = (string)lbl.Content;
             Parameter p   = para[key];
             para.Remove(key);
             p.value = ImageStream.OpenImageb();
             TextBox path = UIElements.ElementAt(i).Value[1] as TextBox;
             RImage  img  = p.value as RImage;
             path.Text = img.Path.LocalPath;
             para.Add(key, p);
         }
     }
 }
コード例 #11
0
 public static void OpenImage()
 {
     OpenFileDialog op = new OpenFileDialog();
     DialogResult dr = op.ShowDialog();
     if (dr == DialogResult.OK)
     {
         RImage img = new RImage(op.SafeFileName, new Uri(op.FileName));
         if (!Register.ContainsKey(op.SafeFileName)){
             List<RImage> lst = new List<RImage>();
             lst.Add(img);
             Register.Add(op.SafeFileName, lst);
         }else
         {
             Register[op.SafeFileName].Add(img);
         }
         cImage = img;
         
         UIAssembler.addTab(img);
     }
 }
コード例 #12
0
        public static void addTab(RImage img)
        {
            TabItem it = new TabItem();

            it.Header = img.Name;
            Grid  g = new Grid();
            Image i = new Image();

            i.Source = img.Image;


            g.Children.Add(i);
            it.Content = g;
            TabControl tbMan = Globals.UIElements["TabManager"] as TabControl;

            tbMan.SelectionChanged   += SelectionChanged;
            tbMan.VerticalAlignment   = VerticalAlignment.Stretch;
            tbMan.HorizontalAlignment = HorizontalAlignment.Stretch;
            tbMan.Items.Add(it);
            tbMan.SelectedIndex = tbMan.Items.Count - 1;
        }
コード例 #13
0
        public bool Compare(RImage img)
        {
            if (width != img.Width || height != img.Height)
            {
                return(false);
            }

            SHA256Managed shaM = new SHA256Managed();

            byte[] img1 = shaM.ComputeHash(pixelData);
            byte[] img2 = shaM.ComputeHash(img.Pixels);

            byte[] hash1 = shaM.ComputeHash(img1);
            byte[] hash2 = shaM.ComputeHash(img2);
            for (int i = 0; i < hash1.Length; i++)
            {
                if (hash1[i] != hash2[i])
                {
                    return(false);
                }
            }
            return(true);
        }
コード例 #14
0
        public static void OpenImage()
        {
            OpenFileDialog op = new OpenFileDialog();
            DialogResult   dr = op.ShowDialog();

            if (dr == DialogResult.OK)
            {
                RImage img = new RImage(op.SafeFileName, new Uri(op.FileName));
                if (!Register.ContainsKey(op.SafeFileName))
                {
                    List <RImage> lst = new List <RImage>();
                    lst.Add(img);
                    Register.Add(op.SafeFileName, lst);
                }
                else
                {
                    Register[op.SafeFileName].Add(img);
                }
                cImage = img;

                UIAssembler.addTab(img);
            }
        }
コード例 #15
0
 public static void setImage(Coor cords,RImage img)
 {
     Register[cords.key][cords.ix] = img;
 }
コード例 #16
0
ファイル: RImage.cs プロジェクト: mohamedgeemi/FCIS-Photoshop
        public bool Compare(RImage img)
        {
            if (width != img.Width || height != img.Height)
                return false;

            SHA256Managed shaM = new SHA256Managed();
            byte[] img1 = shaM.ComputeHash(pixelData);
            byte[] img2 = shaM.ComputeHash(img.Pixels);

            byte[] hash1 = shaM.ComputeHash(img1);
            byte[] hash2 = shaM.ComputeHash(img2);
            for (int i = 0; i < hash1.Length; i++)
            {
                if (hash1[i] != hash2[i])
                    return false;
            }
            return true;
        }
コード例 #17
0
        public static RImage OpenImageb()
        {
            OpenFileDialog op = new OpenFileDialog();
            DialogResult dr = op.ShowDialog();
            RImage img = null;
            if (dr == DialogResult.OK)
            {
                img = new RImage(op.SafeFileName, new Uri(op.FileName));
            }
            return img;

        }
コード例 #18
0
 public static void setImage(Coor cords, RImage img)
 {
     Register[cords.key][cords.ix] = img;
 }