예제 #1
0
        public MainWindow Clone(int levels = 0, bool monochrome = false)
        {
            var pv = new PaletteViewer(levels, monochrome);

            MainWindow w = new MainWindow(latestFileName, pv);

            w.Width  = this.ActualWidth;
            w.Height = this.ActualHeight;

            return(w);
        }
예제 #2
0
        public MainWindow(string initialImagePath, PaletteViewer paletteViewer)
            : this()
        {
            //isGlobalMain = false;

            if (initialImagePath != null)
            {
                //throw new ArgumentNullException("image path cannot be null");
                // it can be null

                if (initialImagePath.Length == 0)
                {
                    throw new ArgumentException("image path cannot be empty if it is not null");
                }

                LoadFromDisk(initialImagePath);
            }

            if (paletteViewer != null)
            {
                Grid.SetRow(paletteViewer, 1);
                CanvasGrid.Children.Add(paletteViewer);
            }
        }