public ScannedImage(String imgBase64, ScanBitDepth bitDepth, bool highQuality) { using (MemoryStream stream = new MemoryStream(Convert.FromBase64String(imgBase64))) using (Image image = Image.FromStream(stream)) { this.bitDepth = bitDepth; Thumbnail = ThumbnailHelper.GetThumbnail(new Bitmap(image)); ScannedImageHelper.GetSmallestBitmap(new Bitmap(image), bitDepth, highQuality, out baseImage, out baseImageEncoded, out baseImageFileFormat); } ////Convertir String a Imagen //// Convert Base64 String to byte[] //byte[] imageBytes = Convert.FromBase64String(imgBase64); //// Convert byte[] to Image //using (var ms = new MemoryStream(imageBytes, 0, imageBytes.Length)) //{ // Image image = Image.FromStream(ms, true); // // // //} }
public ScannedImage(Bitmap img, ScanBitDepth bitDepth, bool highQuality) { this.bitDepth = bitDepth; Thumbnail = ThumbnailHelper.GetThumbnail(img); ScannedImageHelper.GetSmallestBitmap(img, bitDepth, highQuality, out baseImage, out baseImageEncoded, out baseImageFileFormat); }