Jump to content

Recommended Posts

Posted

o meu objectivo é inserir os dados de alunos numa bd importada do access.

eu pretendo q no momento de inserir a foto, abrir uma imagem existente no pc e inserir no campo do tipo ole...

eu ja fiz assim umas coisas:

o sitio onde eu quero meter aquilo chama-s FotoPictureBox

        Dim OpenFileDialog As New OpenFileDialog
       OpenFileDialog.InitialDirectory = My.Computer.FileSystem.SpecialDirectories.MyDocuments
       OpenFileDialog.Filter = "Imagem (*.bmp)|*.bmp|All files (*.*)|*.*"


       If (OpenFileDialog.ShowDialog(Me) = System.Windows.Forms.DialogResult.OK) Then
           Dim FileName As String = OpenFileDialog.FileName

           FotoPictureBox.Image =  fimeName
           'TODO: Add code here to open the file.
       End If

por favor ajudem-me

Posted

o que estas a fazer aqui(fotopicturebox=filename) é atribuir uma string a uma picture box, o que nao podes fazer...

podes fazer entao isto:

dim picbit as bitmap

picbit=image.fromfile(filename)

(picbit é a tua imagem)

fotopicturebox.image=picbit
ou entao mais directamente

fotopicturebox.image=image.fromfile(filename)

cumps

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.