Private Sub imgBrowseBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Dim open As New OpenFileDialog open.Filter = "Image Files (*.gif;*.jpg;*.png)|*.gif;*.jpg;*.png" open.Title = "Select File" open.CheckFileExists = True open.ShowDialog(Me) Try imgTexturl.Text = "file:///" & open.FileName imgPrev.ImageLocation = open.FileName imgTextWidth.Text = imgPrev.Image.Width imgTextHeight.Text = imgPrev.Image.Height Catch ex As Exception ' Do nothing on Exception End Try End Sub
1. Is there a way to get open.FileName to return a relative path instead of absolute so I can leave off the file:///.
2. I am trying to get the image width and height into 2 text boxes. from imgPrev. What am I doing wrong? By the way imgPrev is a picture box.