Ejemplo n.º 1
0
 public void TestImage2WithProgress()
 {
     var imageExtractor = new ImageExtractor();
     imageExtractor.Progress += onExtractionProgress;
     Assembly assembly = Assembly.GetExecutingAssembly();
     using (Stream s = assembly.GetManifestResourceStream(@"GifToSpriteMap.TestImage2.gif"))
     {
         Image image = imageExtractor.Extract(s, DestinationShape.Square);
         Assert.AreEqual(84, image.Width);
         Assert.AreEqual(123, image.Height);
     }
 }
Ejemplo n.º 2
0
        public void TestImage2()
        {
            var imageExtractor = new ImageExtractor();
            Assembly a = Assembly.GetExecutingAssembly();

            using (Stream s = a.GetManifestResourceStream(@"GifToSpriteMap.TestImage2.gif"))
            {
                Image i = imageExtractor.Extract(s, DestinationShape.Square);
                Assert.AreEqual(84, i.Width);
                Assert.AreEqual(123, i.Height);
            }
        }
Ejemplo n.º 3
0
        public void TestCombinedImage()
        {
            var ie = new ImageExtractor();
            var streams = new Stream[2];
            Assembly a = Assembly.GetExecutingAssembly();

            streams[0] = a.GetManifestResourceStream(@"GifToSpriteMap.TestImage1.gif");
            streams[1] = a.GetManifestResourceStream(@"GifToSpriteMap.TestImage2.gif");

            var image = ie.Extract(streams, DestinationShape.Square);
            Assert.AreEqual(237, image.Width);
            Assert.AreEqual(504, image.Height);
        }
Ejemplo n.º 4
0
        public void TestImage1()
        {
            var imageExtractor = new ImageExtractor();
            Assembly assembly = Assembly.GetExecutingAssembly();

            using (
              Stream s = assembly.GetManifestResourceStream(@"GifToSpriteMap.TestImage1.gif"))
            {
                Image image = imageExtractor.Extract(s, DestinationShape.Square);

                Assert.AreEqual(237, image.Width);
                Assert.AreEqual(252, image.Height);
            }
        }
Ejemplo n.º 5
0
        void workerThreadProc(object state)
        {
            var imageExtractor = new ImageExtractor();
            imageExtractor.Progress += onProgress;

            Image image = imageExtractor.Extract(_paths, _destinationShape);

            if (_outputFormat == OutputFormat.Bitmap)
            {
                saveAndShowPng(image);

            }
            else if (_outputFormat == OutputFormat.Dds)
            {
                saveAndShowDds(image);
            }
        }