Noticias Weblogs Foros Wiki Código

RecorteX

399 usuarios y 231 recortes de código
Usuario

Contraseña
Crear cuenta
8 asp csharp css fechas Flash html imagenes java javascript linux mysql oracle php sql SQLServer vbnet web xhtml xml
Top Usuarios
fjmp76 (35)
albin (31)
josuebasurto (29)
juanjo (29)
pedrocaro (9)
stanz (8)
AndiXTRM (7)
Joserra (7)
miiglesi (6)
aplyca (5)
Top Etiquetas
php (38)
vbnet (27)
javascript (26)
html (25)
java (22)
sql (17)
csharp (16)
mysql (13)
xml (13)
css (10)
Flash (7)
imagenes (7)
xhtml (7)
fechas (6)
linux (6)
asp (6)
oracle (5)
SQLServer (5)
web (4)
8 (4)

Cambiar de Image a []byte para almacenar en DB

Cambiar de Image a []byte para almacenar en DB
 
  		public static byte[] Image2Byte(System.Drawing.Image image)
		{
			// make a memory stream to work with the image bytes
			MemoryStream imageStream = new MemoryStream();
 
			// put the image into the memory stream
			image.Save(imageStream, System.Drawing.Imaging.ImageFormat.Jpeg);
 
			return imageStream.GetBuffer();
		}
 
Identifícate para dejar un comentario.
info@recortex.com - Proyecto: Juanjo Navarro, 2006 - Diseño: Albin - Información legal y técnica