Exemple #1
0
        public void IO_ZipProject_GreyscaleColorConfig()
        {
            //arrange
            Color     grey            = Color.Black;
            Color     color           = Color.Red;
            string    zipFilename     = "testProject.ppp";
            Bitmap    greyscaleBitmap = MakeBitmap(grey);
            Bitmap    colorBitmap     = MakeBitmap(color);
            PPConfig  config          = new PPConfig("path\\palette_filename.gpl");
            PPProject project         = new PPProject(greyscaleBitmap, colorBitmap, config);

            //act
            PerpetualPaintLibrary.IO.ZipProject(zipFilename, project);
            //assert
            Assert.IsTrue(File.Exists(zipFilename));

            PPProject result = PerpetualPaintLibrary.IO.LoadProject(zipFilename);

            Assert.IsNull(result.ColorPalette);
            Assert.IsNotNull(result.GreyscaleBitmap);
            Assert.IsNotNull(result.ColorBitmap);
            Assert.IsNotNull(result.Config);
            Assert.IsTrue(ColorsMatch(grey, result.GreyscaleBitmap.GetPixel(0, 0)));
            Assert.IsTrue(ColorsMatch(color, result.ColorBitmap.GetPixel(0, 0)));
            Assert.AreEqual(config.PaletteFileName, result.Config.PaletteFileName);
        }
Exemple #2
0
 public ProjectOptionsDialog(PPConfig config)
 {
     paletteOption = config.PaletteOption;
     InitForm();
 }