Hi, I have openfiledialog, and I use this code to open the file on pc but I get error that (formfile is not a member of system.drawing.image) below is the code.Also I get error message about the code below as well that (fromstream is not a member of system.drawing.image)Code:Private Sub btnBrowse_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnBrowse.Click With OpenFileDialog1 .InitialDirectory = "\My Document\My Pictures" .Filter = "All Files|*.*|Bitmaps|*.bmp|GIFs|*.gif|JPEGs|*.jpg" .FilterIndex = 2 End With If OpenFileDialog1.ShowDialog() = DialogResult.OK Then With Picture1 .Image = Image.Fromfile(OpenFileDialog1.FileName) .SizeMode = PictureBoxSizeMode.CenterImage End With Me.txtFileName.Text = OpenFileDialog1.FileName End If End Sub
Could anyone help.Code:Private Sub btnDisplay_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnDisplay.Click Dim arrPicture() As Byte = _ CType(dsPictures.Tables(0).Rows(lstPictures.SelectedIndex)("Picture"), _ Byte()) Dim ms As New MemoryStream(arrPicture) With Picture2 .Image = Image.fromStream(ms) .SizeMode = PictureBoxSizeMode.StretchImage End With txtFileName.Text = _ dsPictures.Tables(0).Rows(lstPictures.SelectedIndex)("PictureName").ToString ms.Close() End Sub


Reply With Quote



