Пример #1
0
 private SixLabors.Primitives.Size LoadPng(MemoryStream stream)
 {
     using (Image <Rgba32> image = CoreImage.Load <Rgba32>(stream))
     {
         return(new SixLabors.Primitives.Size(image.Width, image.Height));
     }
 }
Пример #2
0
 public void ReadImages()
 {
     if (this.bmpStream == null)
     {
         this.bmpStream          = File.OpenRead("../ImageSharp.Tests/TestImages/Formats/Bmp/Car.bmp");
         this.bmpCore            = CoreImage.Load <Rgba32>(this.bmpStream);
         this.bmpStream.Position = 0;
         this.bmpDrawing         = Image.FromStream(this.bmpStream);
     }
 }
Пример #3
0
 public void ReadImage()
 {
     if (this.image == null)
     {
         using (FileStream stream = File.OpenRead("../ImageSharp.Tests/TestImages/Formats/Bmp/Car.bmp"))
         {
             this.image = CoreImage.Load <Rgba32>(stream);
         }
     }
 }
Пример #4
0
 public void ReadImage()
 {
     if (this.image == null)
     {
         using (FileStream stream = File.OpenRead("/Users/pknopf/git/ImageSharp/tests/Images/Input/Bmp/Car.bmp"))
         {
             this.image = CoreImage.Load <Rgba32>(stream);
         }
     }
 }
Пример #5
0
 public CoreSize JpegImageSharpPdfJs()
 {
     using (MemoryStream memoryStream = new MemoryStream(this.jpegBytes))
     {
         using (Image <Rgba32> image = CoreImage.Load <Rgba32>(memoryStream, new PdfJsJpegDecoder()))
         {
             return(new CoreSize(image.Width, image.Height));
         }
     }
 }
Пример #6
0
 public CoreSize GifCore()
 {
     using (MemoryStream memoryStream = new MemoryStream(this.gifBytes))
     {
         using (Image <Rgba32> image = CoreImage.Load <Rgba32>(memoryStream))
         {
             return(new CoreSize(image.Width, image.Height));
         }
     }
 }
Пример #7
0
 public void ReadImages()
 {
     if (this.bmpStream == null)
     {
         this.bmpStream          = File.OpenRead("/Users/pknopf/git/ImageSharp/tests/Images/Input/Bmp/Car.bmp");
         this.bmpCore            = CoreImage.Load <Rgba32>(this.bmpStream);
         this.bmpStream.Position = 0;
         //this.bmpDrawing = Image.FromStream(this.bmpStream);
     }
 }
Пример #8
0
 public CoreSize PngCore()
 {
     using (var memoryStream = new MemoryStream(this.pngBytes))
     {
         using (var image = CoreImage.Load <Rgba32>(memoryStream))
         {
             return(new CoreSize(image.Width, image.Height));
         }
     }
 }
Пример #9
0
 public void ReadImages()
 {
     if (this.bmpStream == null)
     {
         const string TestImage = TestImages.Bmp.Car;
         this.bmpStream          = File.OpenRead(Path.Combine(TestEnvironment.InputImagesDirectoryFullPath, TestImage));
         this.bmpCore            = CoreImage.Load <Rgba32>(this.bmpStream);
         this.bmpStream.Position = 0;
         this.bmpDrawing         = Image.FromStream(this.bmpStream);
     }
 }
Пример #10
0
 public void ReadImages()
 {
     if (this.bmpStream == null)
     {
         string path = this.LargeImage
                           ? "../ImageSharp.Tests/TestImages/Formats/Jpg/baseline/jpeg420exif.jpg"
                           : "../ImageSharp.Tests/TestImages/Formats/Bmp/Car.bmp";
         this.bmpStream          = File.OpenRead(path);
         this.bmpCore            = CoreImage.Load <Rgba32>(this.bmpStream);
         this.bmpStream.Position = 0;
     }
 }
Пример #11
0
        public void ReadImages()
        {
            if (this.bmpStream == null)
            {
                string path = Path.Combine(
                    TestEnvironment.InputImagesDirectoryFullPath,
                    this.LargeImage ? TestImages.Jpeg.Baseline.Jpeg420Exif : TestImages.Bmp.Car);


                this.bmpStream          = File.OpenRead(path);
                this.bmpCore            = CoreImage.Load <Rgba32>(this.bmpStream);
                this.bmpStream.Position = 0;
                this.bmpDrawing         = Image.FromStream(this.bmpStream);
            }
        }
Пример #12
0
            protected override void ReadFilesImpl()
            {
                base.ReadFilesImpl();

                foreach (KeyValuePair <string, byte[]> kv in this.fileNamesToBytes)
                {
                    byte[] bytes = kv.Value;
                    string fn    = kv.Key;

                    using (var ms1 = new MemoryStream(bytes))
                    {
                        this.fileNamesToImageSharpImages[fn] = CoreImage.Load <Rgba32>(ms1);
                    }

                    this.fileNamesToSystemDrawingImages[fn] = new Bitmap(new MemoryStream(bytes));
                }
            }
Пример #13
0
 public void DecodeJpegImageSharpNwq()
 {
     this.ForEachStream(
         ms => CoreImage.Load <Rgba32>(ms)
         );
 }