Jump to content

..:: Importing Pictures ::..

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
4 replies to this topic

#1
bahrain

bahrain

    Newbie

  • Members
  • PipPip
  • 23 posts
Hello folks...

I've started learning VB few weeks back so if my question sound stupid ,, well .. I'm sorry..

the thing is I'm trying to import a picture from a file into a form ,, and I thought I should do this By using the open file dialog but I don't know how !!! ..

So pleas I'll appreciate you're help..

Thanks in advance

Yeah and by the way I'm using VB 2008.

#2
Xav

Xav

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 13,118 posts
If Not openFileDialog1.ShowDialog() = DialogResult.OK Then Exit Sub

Try
PictureBox1.Image = Image.FromFile(openFileDialog1.FileName)

Catch (exc As OutOfMemoryException)
MessageBox.Show("You did not select a valid image file!")

End Try

Jordan said:

Good members, like yourself, stick around and post for ages to come!
Mr. Xav | Blog | Forums

#3
bahrain

bahrain

    Newbie

  • Members
  • PipPip
  • 23 posts
Thank U alot Santa Claus

But what if I want the user to be able to change its size or to move it inside the PictureBox frame ??

#4
Xav

Xav

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 13,118 posts
You will have to write code that allows the user to change the size, and respond to user interaction.

BTW, call me "Xav", that's my real username. Santa Claus is temporary.
Jordan said:

Good members, like yourself, stick around and post for ages to come!
Mr. Xav | Blog | Forums

#5
bahrain

bahrain

    Newbie

  • Members
  • PipPip
  • 23 posts

Santa Claus said:

You will have to write code that allows the user to change the size, and respond to user interaction.

and how can I do this??!!