Kattaleya Posted May 19, 2014 at 11:45 AM Report #556242 Posted May 19, 2014 at 11:45 AM Olá, gostava de saber como posso fazer para que o utilizador importe para uma picturebox a imagem que deseja. 🙂 em visual studio 2010
killerbest Posted May 19, 2014 at 01:26 PM Report #556263 Posted May 19, 2014 at 01:26 PM (edited) Tens de inserir um OpenFileDialog no form, e depois metes esse codigo no botão Dim in_file As String Dim obj_openfile As New OpenFileDialog Try OpenFileDialog1.Filter = "JPEG Files (*.jpg)|*.jpg|RAW Files (*.raw)|*.raw" OpenFileDialog1.FilterIndex = 1 OpenFileDialog1.Title = "Open Image File" OpenFileDialog1.Multiselect = True obj_openfile = OpenFileDialog1 'Show the dialog If obj_openfile.ShowDialog = Windows.Forms.DialogResult.OK Then in_file = obj_openfile.FileName.ToString PictureBox1.Image = Image.FromFile(obj_openfile.FileName) 'Me.PictureBox1.Image = New System.Drawing.Bitmap(in_file) obj_openfile.Dispose() obj_openfile = Nothing Else Exit Sub End If Catch ex As Exception MsgBox(ex.Message) End Try Edited May 19, 2014 at 01:28 PM by killerbest
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now