Beispiel #1
0
 public void Flush()
 {
     cords  = ImageStream.getCoor(this);
     source = BitmapSource.Create(width, height, img.DpiX, img.DpiY, pf, null, pixelData, rawStride);
     UIAssembler.updateTab(source);
     Sync();
 }
Beispiel #2
0
        private static void SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (e.AddedItems.Count == 0)
            {
                return;
            }
            TabItem tb  = e.AddedItems[0] as TabItem;
            Grid    gd  = tb.Content as Grid;
            Image   img = VisualTreeHelper.GetChild(gd, 0) as Image;

            ImageStream.setCurrentImage(img);
            if (Globals.UIElements.ContainsKey("StatBar"))
            {
                TextBlock lbl = new TextBlock();
                string    co  = "";
                if (ImageStream.CurrentImage != null)
                {
                    co += ImageStream.CurrentImage.Name + " | Width = ";
                    co += ImageStream.CurrentImage.Bitmap.Width + " | Height = ";
                    co += ImageStream.CurrentImage.Bitmap.Height;
                }
                lbl.Text = co;
                StatusBar sb = Globals.UIElements["StatBar"] as StatusBar;
                sb.Items.Clear();
                sb.Items.Add(lbl);
            }
        }
 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);
         }
     }
 }
 private void Button_Click_2(object sender, RoutedEventArgs e)
 {
     ImageStream.SaveImage();
 }
 private void Button_Click_1(object sender, RoutedEventArgs e)
 {
     ImageStream.OpenImage();
 }
 private void OpenButton_Click(object sender, RoutedEventArgs e)
 {
     ImageStream.OpenImage();
     UIAssembler.AssembleUI();
 }
Beispiel #7
0
 public void FlushBitmap(Bitmap b)
 {
     cords = ImageStream.getCoor(this);
     setBitmap(Globals.Bitmap2BitmapImage(b), b);
     Sync();
 }
Beispiel #8
0
 void Sync()
 {
     ImageStream.setImage(cords, this);
 }