protected override void instructions() { RImage x = (RImage)parameters["Value"].value; Bitmap res = ImageProcOp.AddPictures(ImageStream.CurrentImage.Bitmap, x.Bitmap); ImageStream.CurrentImage.FlushBitmap(res); }
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); }
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; } } }
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; } } } }
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(); }
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); }
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; }
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()); }
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); } } }
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); } }
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); }
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); } }
public static void setImage(Coor cords,RImage img) { Register[cords.key][cords.ix] = img; }
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; }
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; }
public static void setImage(Coor cords, RImage img) { Register[cords.key][cords.ix] = img; }