public static byte[] imageToByteArray(string Ruta) { try { Image imageIn = Image.FromFile(Ruta); MemoryStream ms = new MemoryStream(); Bitmap bmPhoto = new Bitmap(imageIn); bmPhoto.SetResolution(100, 100); bmPhoto.Save(ms, imageIn.RawFormat); return ms.ToArray(); } catch { return new byte[0]; } }
Este es el enlace a la forma como lo hacia antes.
No hay comentarios:
Publicar un comentario