예제 #1
0
        private void OnOpen(object sender, EventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();

            ofd.Filter = "Image Files(*.BMP; *.JPG; *.PNG)| *.BMP; *.JPG; *.PNG; | All files(*.*) | *.*";

            if (ofd.ShowDialog() == DialogResult.OK)
            {
                ImageBundle ib = new ImageBundle(ofd.FileName);
                ib.FileName = ofd.SafeFileName;
                store.AddImage(ib);
            }
        }
예제 #2
0
        private void OnImportJAPG(object sender, EventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();

            ofd.Filter = "Image File(*.JAPG)| *.JAPG; | All files(*.*) | *.*";

            if (ofd.ShowDialog() == DialogResult.OK)
            {
                byte[] rawData = System.IO.File.ReadAllBytes(ofd.FileName);
                Compression.JAPGDecompressor decompress = new Compression.JAPGDecompressor(rawData);
                ImageBundle ib = new ImageBundle(decompress.Decompress());
                ib.FilePath = ofd.FileName;
                ib.FileName = ofd.SafeFileName;
                store.AddImage(ib);
            }
        }
예제 #3
0
 public void AddImage(ImageBundle b)
 {
     images.Add(b);
     CurrentImage = b;
     OnPropertyChanged("ImageAdded");
 }