Exemplo n.º 1
0
 private byte[] BitmapToByteArray(Bitmap bitmap, string imageType)
 {
     using (MemoryStream memoryStream = new MemoryStream())
     {
         bitmap.Save(memoryStream, _imageFormatResolver.Resolve(imageType));
         return(memoryStream.ToArray());
     }
 }
 public void ResolvePngFormatTest()
 {
     Assert.Equal(ImageFormat.Png, _imageFormatResolver.Resolve("png"));
     Assert.Equal(ImageFormat.Png, _imageFormatResolver.Resolve("PNG"));
 }