예제 #1
0
        public void From32bppArgbSystemDrawingBitmap <TPixel>(TestImageProvider <TPixel> dummyProvider)
            where TPixel : unmanaged, IPixel <TPixel>
        {
            string path = TestFile.GetInputFileFullPath(TestImages.Png.Splash);

            using (var sdBitmap = new System.Drawing.Bitmap(path))
            {
                using (Image <TPixel> image = SystemDrawingBridge.From32bppArgbSystemDrawingBitmap <TPixel>(sdBitmap))
                {
                    image.DebugSave(dummyProvider);
                }
            }
        }
예제 #2
0
        public void From32bppArgbSystemDrawingBitmap2 <TPixel>(TestImageProvider <TPixel> provider)
            where TPixel : unmanaged, IPixel <TPixel>
        {
            if (TestEnvironment.IsLinux)
            {
                return;
            }

            string path = SavePng(provider, PngColorType.RgbWithAlpha);

            using (var sdBitmap = new System.Drawing.Bitmap(path))
            {
                using (Image <TPixel> original = provider.GetImage())
                    using (Image <TPixel> resaved = SystemDrawingBridge.From32bppArgbSystemDrawingBitmap <TPixel>(sdBitmap))
                    {
                        ImageComparer comparer = ImageComparer.Exact;
                        comparer.VerifySimilarity(original, resaved);
                    }
            }
        }