Noticias Weblogs Foros Wiki Código

RecorteX

458 usuarios y 235 recortes de código
Usuario

Contraseña
Crear cuenta
asp csharp css fechas Flash html imagenes java javascript linux mysql oracle php sql SQLServer url vbnet web xhtml xml
Top Usuarios
fjmp76 (35)
albin (31)
josuebasurto (31)
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 (23)
csharp (18)
sql (17)
xml (13)
mysql (13)
css (10)
xhtml (7)
Flash (7)
imagenes (7)
linux (6)
fechas (6)
asp (6)
oracle (5)
url (5)
web (5)
SQLServer (5)

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