stanbuggy
Member
- Joined
- Oct 25, 2010
- Messages
- 18
- Programming Experience
- Beginner
Hi Guys, i have this problem i would want to solve urgently...when i import a picture into my picture box in vb.net using this code
Dim img As Image
OpenFileDialog1.Filter = "images|*.gif;*png;*jpg;*.ico"
If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
img = Image.FromFile(OpenFileDialog1.FileName)
PictureBox1.Image = img.GetThumbnailImage(144, 142, Nothing, Nothing)
End If
i want a suitation when i click my submit button the image uploaded into the picture box is copied to a folder so i dont have to deal with a complete path problem whenever i move my application to another system.
I hope u get my problem..
here is my code for submitting into the database
query5 = "insert into students(regnum,name,tel,addy,email,sex,date_reg,pix,course,duration,amount,class_ses) values ('" & txtregnum.Text & "','" & txtfname.Text & "','" & txttel.Text & "','" & txtaddy.Text & "','" & txtemail.Text & "','" & cmbsex.Text & "','" & dtpreg.Text & "','" & OpenFileDialog1.FileName & "','" & cmbcourse.Text & "','" & txtduration.Text & "','" & txtprice.Text & "','" & session.Text & "')"
dataconn5 = New SqlCommand(query5, conn5)
dataconn5.ExecuteNonQuery()
img = Image.FromFile("C:\Documents and Settings\stanley\My Documents\My Pictures\img_large_watermarked.jpg")
PictureBox1.Image = img.GetThumbnailImage(174, 188, Nothing, Nothing)
The img_large_watermarked.jpg image shows up on successful submission...i also want to change that too..cos as soon as i moved systems it could not detect C:\Documents and Settings\stanley\My Documents\My Pictures\img_large_watermarked.jpg and that caused errors.
So pls buddies i need help.
Thanks in Advance and have a Blessed 2011
Dim img As Image
OpenFileDialog1.Filter = "images|*.gif;*png;*jpg;*.ico"
If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
img = Image.FromFile(OpenFileDialog1.FileName)
PictureBox1.Image = img.GetThumbnailImage(144, 142, Nothing, Nothing)
End If
i want a suitation when i click my submit button the image uploaded into the picture box is copied to a folder so i dont have to deal with a complete path problem whenever i move my application to another system.
I hope u get my problem..
here is my code for submitting into the database
query5 = "insert into students(regnum,name,tel,addy,email,sex,date_reg,pix,course,duration,amount,class_ses) values ('" & txtregnum.Text & "','" & txtfname.Text & "','" & txttel.Text & "','" & txtaddy.Text & "','" & txtemail.Text & "','" & cmbsex.Text & "','" & dtpreg.Text & "','" & OpenFileDialog1.FileName & "','" & cmbcourse.Text & "','" & txtduration.Text & "','" & txtprice.Text & "','" & session.Text & "')"
dataconn5 = New SqlCommand(query5, conn5)
dataconn5.ExecuteNonQuery()
img = Image.FromFile("C:\Documents and Settings\stanley\My Documents\My Pictures\img_large_watermarked.jpg")
PictureBox1.Image = img.GetThumbnailImage(174, 188, Nothing, Nothing)
The img_large_watermarked.jpg image shows up on successful submission...i also want to change that too..cos as soon as i moved systems it could not detect C:\Documents and Settings\stanley\My Documents\My Pictures\img_large_watermarked.jpg and that caused errors.
So pls buddies i need help.
Thanks in Advance and have a Blessed 2011