Hola a todos.
Estoy tratando de pasar este codigo a C#
Código:
'Esta función convierte la imagen a Byte
Public Function ImageToByte(ByVal pImagen As Image) As Byte()
Dim mImage() As Byte
Try
If Not IsNothing(pImagen) Then
Dim ms As New System.IO.MemoryStream
pImagen.Save(ms, pImagen.RawFormat)
mImage = ms.GetBuffer
ms.Close()
Return mImage
End If
Catch
End Try
End Function
Lo que logre hace quedo asi:
Código:
public byte[] ImageToByte(Image imagencita)
{
byte[] imgbyte;
System.IO.MemoryStream ms = new System.IO.MemoryStream();
imagencita.Save(ms,imagencita.RawFormat);
imgbyte = ms.GetBuffer();
ms.Close();
return imgbyte;
}
Se que esta medio bien, pero no entiendo mucho de vb asi que hasta donde lo loque creo que esta medio bien.
Pero aun no puedo hacer este reporte
http://www.dotnetcr.com/Libreria.aspx?art=62
Muchas gracias a los que me puedan ayudar.