Uploading picture (browse for picture)

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Dec 2007
Posts: 38
Reputation: omotoyosi is an unknown quantity at this point 
Solved Threads: 1
omotoyosi omotoyosi is offline Offline
Light Poster

Uploading picture (browse for picture)

 
0
  #1
Jan 8th, 2008
Please all, I am a young female programmer who designed a form. In the form there is a field for image. How will i add a browse to it so that the person felling the form will browse to pick the picture from his system.

Please ATTEND URGENTLY TO IT.
TANX.
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 252
Reputation: ProfessorPC is an unknown quantity at this point 
Solved Threads: 27
ProfessorPC ProfessorPC is offline Offline
Posting Whiz in Training

Re: Uploading picture (browse for picture)

 
0
  #2
Jan 8th, 2008
If you are using VS you can drag an OpenFileDialog, 3 buttons, textbox and a picturebox to your form.
With your first button (Browse). In this buttons click event add
  1. OpenFileDialog.Title = "Get Image"
  2. OpenFileDialog.ShowDialog()
Go back to your form and double click the OpenFileDialog. Add this code
  1. textbox.text = OpenFileDialog.FileName

go to your second button (Upload) click event and add
  1. if (textbox.text.Trim() <> "") Then
  2. PictureBox.Image = Image.FromFile(textbox.text)

Finally in the third button (Remove). Open the click event for this button and add.
  1. Picturebox.image = Nothing

this should take care of browsing, displaying path, uploading and removing the image from your form.
Last edited by ProfessorPC; Jan 8th, 2008 at 10:23 am.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 2,641
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Solved Threads: 245
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: Uploading picture (browse for picture)

 
0
  #3
Jan 8th, 2008
add/drag opendialog control in your form , one label (for path view), one picture box (for image view) and one button (for browse image).
in your button browse add this code :
  1. With OpenFileDialog1
  2. '.InitialDirectory = "C:\"
  3. .Filter = "All Files|*.*|Bitmaps|*.bmp|GIFs|*.gif|JPEGs|*.jpg"
  4. .FilterIndex = 4
  5. End With
  6.  
  7. If OpenFileDialog1.ShowDialog() = DialogResult.OK Then
  8. PictureBox1.Image = Image.FromFile(OpenFileDialog1.FileName)
  9. PictureBox1.SizeMode = PictureBoxSizeMode.StretchImage
  10. PictureBox1.BorderStyle = BorderStyle.Fixed3D
  11. lblFilePath.Text = OpenFileDialog1.FileName()
  12. End If
you can change the filter index to set image extension at first open. in this code filter index = 4 will set to jpeg, so when first open just jpeg image will shown. change filter index as u need.

Ok. all for the best
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 38
Reputation: omotoyosi is an unknown quantity at this point 
Solved Threads: 1
omotoyosi omotoyosi is offline Offline
Light Poster

Re: Uploading picture (browse for picture)

 
0
  #4
Jan 9th, 2008
tanx,
I realy apreciated ur concern.it has worked.
Another problem is on the deploying, if i install on another system it will not see the connection. why this i saved the database in my d: drive. pls. help.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 63
Reputation: Sawamura is an unknown quantity at this point 
Solved Threads: 6
Sawamura's Avatar
Sawamura Sawamura is offline Offline
Junior Poster in Training

Re: Uploading picture (browse for picture)

 
0
  #5
Jan 9th, 2008
can you specify the problem please...
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 291
Reputation: ericstenson is an unknown quantity at this point 
Solved Threads: 29
Team Colleague
ericstenson's Avatar
ericstenson ericstenson is offline Offline
Posting Whiz in Training

Re: Uploading picture (browse for picture)

 
0
  #6
Jan 9th, 2008
must love Google translations... maybe posting in the native language would make it easier to understand. (ok, that was a little mean.)
--
"Dummy."
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 2
Reputation: mahender.B is an unknown quantity at this point 
Solved Threads: 0
mahender.B mahender.B is offline Offline
Newbie Poster

Re: Uploading picture (browse for picture)

 
0
  #7
Jun 18th, 2008
How is upload the picture in vb.net
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 2
Reputation: mahender.B is an unknown quantity at this point 
Solved Threads: 0
mahender.B mahender.B is offline Offline
Newbie Poster

Re: Uploading picture (browse for picture)

 
0
  #8
Jun 18th, 2008
How to upload image and how to store images from database
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 2
Reputation: vmreddy is an unknown quantity at this point 
Solved Threads: 0
vmreddy vmreddy is offline Offline
Newbie Poster

Re: Uploading picture (browse for picture)

 
0
  #9
Jun 18th, 2008
Dim UploadFileControl As FileUpload
UploadFileControl = ImageFieldID
If UploadFileControl.HasFile Then
UpldFile.Add(UploadFileControl)
// check for extention of the file
if exist()
// save the image

End If
Last edited by vmreddy; Jun 18th, 2008 at 10:32 am.
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 2
Reputation: zumanequeen is an unknown quantity at this point 
Solved Threads: 0
zumanequeen zumanequeen is offline Offline
Newbie Poster

Re: Uploading picture (browse for picture)

 
0
  #10
Aug 25th, 2008
hi there..im new in vb.net..actually i want to upload a pic(browse for pic) into my form...but then,i dont see any openfiledialog n picturebox in my toolbox to be dragged in..pls help me asap..tq..
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the VB.NET Forum


Views: 8484 | Replies: 11
Thread Tools Search this Thread



Tag cloud for VB.NET
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC