Imagen en memoria TO Dataset

16/07/2004 - 19:18 por dgironal | Informe spam
Muy buenas, la cuestión:


Una imagen almacenada en un fichero trasladarla a un "DataSet"

Dim fs As System.IO.FileStream
Dim br As System.IO.BinaryReader
Dim row As DataRow

fs = New System.IO.FileStream(path, IO.FileMode.Open)
br = New System.IO.BinaryReader(fs)
row(1) = br.ReadBytes(br.BaseStream.Length)

SIN PROBLEMAS !!!

Pero como hacer lo mismo con una imagen en memoría

Dim imagen As System.Drawing.Image
imagen = imagen.FromFile(path)
imagen = imagen.GetThumbnailImage(100, 100, Nothing, Nothing)

¿Cómo trasladarla al "DataSet"?

Gracias de antemano

Preguntas similare

Leer las respuestas

#1 Pedro Luna Montalvo
17/07/2004 - 02:14 | Informe spam
Continuo luego de tu codigo

Mostrar la cita
Dim oBuffer As New MemoryStream ' Creo un Stream de memoria
imagen.Save(oBuffer, oImagen.RawFormat) ' Grabo el archivo en el Stream
row(1) = oBuffer.GetBuffer() ' Recupero los bytes

Saludos
Pedro Luna, MVP
Gye, Ecu


"dgironal" escribió en el mensaje
news:%
Mostrar la cita
#2 Pedro Luna Montalvo
17/07/2004 - 02:21 | Informe spam
Una correccion en esta linea:
imagen.Save(oBuffer, imagen.RawFormat) 'es imagen en lugar de oImagen

Esto demuestra que el Outlook Express es un mal editor de codigo ;)

Saludos,
Pedro Luna, MVP
Gye, Ecu


"Pedro Luna Montalvo" escribió en el mensaje
news:
Mostrar la cita
#3 dgironal
19/07/2004 - 09:02 | Informe spam
Muchísimas gracias ahora mismo lo pruebo.
Ads by Google
Search Busqueda sugerida