You are on page 1of 3

Manejo de Imgenes

Imports System.IO Private SaveImage As Boolean = False Private NomAr As String = "" Private Sub btnSeleccione_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSeleccione.Click Try OFDAbrir.Filter = "All files (*.*)|*.*|Images Files (*.jpg,*.jpeg)|*.jpg;*jpeg" OFDAbrir.FilterIndex = 2 OFDAbrir.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) If OFDAbrir.ShowDialog() = DialogResult.OK Then NomAr = OFDAbrir.FileName picFoto.Image = Image.FromFile(NomAr) SaveImage = True Else MessageBox.Show("No Selecciono Ningun Archivo") SaveImage = False End If Catch ex As Exception End Try End Sub If SaveImage = True Then Dim ms As New System.IO.MemoryStream() picFoto.Image.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg) .propFoto = ms.GetBuffer() End If Dim bits As Byte() = CType(Dato que viene de la BD, Byte()) Dim memorybits As New MemoryStream(bits) Dim bitmap As New Bitmap(memorybits) picFoto.Image = bitmap

Programas: CI RC IS

Programas: CI RC IS

You might also like