Foros del Web » Programación para mayores de 30 ;) » .NET »

conversión de imagen a binario

Estas en el tema de conversión de imagen a binario en el foro de .NET en Foros del Web. en esta foto esta el problema http://oi66.tinypic.com/5k59mu.jpg HOLA CHICOS TENGO UN PROBLE MITA ES QUE ESTOY CONVIRTIENDO UNA IMAGEN A BYTE Y LA CONVERSION ME ...
  #1 (permalink)  
Antiguo 19/06/2016, 18:22
 
Fecha de Ingreso: junio-2016
Mensajes: 1
Antigüedad: 7 años, 9 meses
Puntos: 0
conversión de imagen a binario

en esta foto esta el problema

http://oi66.tinypic.com/5k59mu.jpg

HOLA CHICOS TENGO UN PROBLE MITA ES QUE ESTOY CONVIRTIENDO UNA IMAGEN A BYTE Y LA CONVERSION ME LO HACE NITIDA PERO CUANDO VEO LA IMAGEN EN LA BASE DE DATOS O EN EL FORMILARIO ESTA CORTADA
ME DAN UNA AYUDA

ESTOS SON LOS CODIGO

SOLO LES PUSE LOS DEL PICTURE Y LOS DEL BOTON QUE ME HACE LA CONVERSCION
Private Sub FOTOPictureBox_Click_2(sender As Object, e As EventArgs) Handles FOTOPictureBox.Click
If OpenFileDialog1.ShowDialog(Me) = DialogResult.OK Then

'Get the image name

Dim img As String = OpenFileDialog1.FileName



'Create a new Bitmap and display it

FOTOPictureBox.Image = System.Drawing.Bitmap.FromFile(img)

End If

End Sub

Private Sub Button2_Click_1(sender As Object, e As EventArgs) Handles Button2.Click
Dim ms = New MemoryStream()
FOTOPictureBox.Image.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg) ' Use appropriate format here
bytes = ms.ToArray()
End Sub

Última edición por CiudadDragon; 19/06/2016 a las 19:50
  #2 (permalink)  
Antiguo 21/06/2016, 12:42
 
Fecha de Ingreso: octubre-2009
Mensajes: 305
Antigüedad: 14 años, 6 meses
Puntos: 29
Respuesta: conversion de imagen a bynario

no es recomendable almacenar imágenes en bases de datos, de hacerlo te recomiendo que el binario lo recodifiques a base64, para así mantener la integridad binaria.

y por favor, instale un corrector ortográfico.

Etiquetas: Ninguno
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 11:27.