Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
NEED YOUR HELP PLEASE..
#1
i'm having problem with my program.. its like directory for the students i want to include picture in the student info.. but i dont know how to do that.. is there any way i can do that? please i really need your help for these.. any help will do.. <!-- sCry --><img src="{SMILIES_PATH}/icon_cry.gif" alt="Cry" title="Crying or Very Sad" /><!-- sCry -->
#2
Can you be more specific? I don't understand what do you mean.
Also known as Rocketalypse.
System.out.println("I prefer Java.");
#3
I don't really know what you mean either. To display a picture in your program, you're going to want to use the PictureBox control, but that's all the help that I can really give you with the information that you provided.
My Blog | My Setup | My Videos | Have a wonderful day.
#4
oh.. im sorry.. lets say i have a database table name student_info. one of the fields i created is the imagepath.. i want to save the path of the image in that field.. and after saving that if i want to view the student info in my program..the student info appears and so as the image.. how can i do that?
#5
I'm going to sleep right now, meaning I don't have time to help, at the moment. If Brandon doesn't help you in a few hours, when I wake up I will.

Right now, it is like 0:50 am here, so yeah. I usually wake up at 08:00/08:30(am).
Also known as Rocketalypse.
System.out.println("I prefer Java.");
#6
jochen29 Wrote:oh.. im sorry.. lets say i have a database table name student_info. one of the fields i created is the imagepath.. i want to save the path of the image in that field.. and after saving that if i want to view the student info in my program..the student info appears and so as the image.. how can i do that?

here if this would help you understand..


[Image: 4604f0fa.png]
#7
What you could do is use this code when you click buttons for scrolling (Next, Previous, First, Last):
[code2=vbnet]Try
PictureBox1.Image = Image.FromFile(ImageTextBox.Text)
Catch ex As Exception
MsgBox(ex.Message) ' Style your message box a bit, if you want.
End Try[/code2]
When an user clicks the upload button, add this code:
[code2=vbnet]Dim OpenImage As New OpenFileDialog
OpenImage.Title = "Upload your image"
OpenImage.InitialDirectory = "C:\"
OpenImage.Filter = "Images Files|*.jpg;*.png;*.jpeg;*.bmp"
Dim x = OpenImage.ShowDialog()

If x = DialogResult.OK Then
Try
PictureBox1.Image = Image.FromFile(OpenImage.FileName)
ImageTextBox.Text = OpenImage.FileName
Catch ex As Exception
MsgBox(ex.Message) ' Style your message box a bit, if you want.
End Try
End If[/code2]

That is basically it. That's everything you need in order to display an image. If you want to display .GIF images, you need to use StreamWriter, otherwise it will say "Out of Memory". When the form loads, it doesn't matter which file extension the image have, it will show "Out of Memory", so don't add it there. Everything else works like a charm. If this didn't help you totally, it at least gave you some kind of idea how would it work.
Also known as Rocketalypse.
System.out.println("I prefer Java.");
#8
so how can i save it to the database then? what i want to save is the image path and then.. when i want to scroll it and show it to the picture box how can i call it from the database..to show the image of the particular person? lets say i run the program here must be the output..


[Image: c9db343c.png]


and what if i want to create a folder inside the program folder to put the images there?
#9
Are you using MySQL database or Service-Based (in VB/VS) database?
Also known as Rocketalypse.
System.out.println("I prefer Java.");
#10
yea i'm using MySQL database..
#11
I cannot help you then. I've never used MySQL databases. Brandon will help you when he logs on.

Basically what you want to do is, retrieve a value from the path column and then set PictureBox's image to it.
Also known as Rocketalypse.
System.out.println("I prefer Java.");
#12
oh.. <!-- sCry --><img src="{SMILIES_PATH}/icon_cry.gif" alt="Cry" title="Crying or Very Sad" /><!-- sCry --> i see.. thanks for the help though.. maybe i should wait for brandonio to help me.. thanks man.

yea your right that's what i want to do.. but i don't know how to do that.. that's why i need anyone's help.. and i'm also new to VB.net
#13
Thanks for helping Vinwarez!

Anyway, there is a very basic premise to what you are trying to do. Basically, user chooses image, image gets uploaded, URL of that image gets saved in the database.

So, for example, if you specify a local image for the student "John Smith", the image might get renamed as "johnsmith81212.jpg" and then uploaded via FTP to the url "site.com/images/johnsmith81212.jpg". Then, the MySQL image field for "John Smith" is updated to "johnsmith81212.jpg". Then, when retrieving the image, the program reads the MySQL field, downloads the image, and displays it into the PictureBox.

This may not be the best way of doing it, but it is how I did it in a huge piece of software for a client and it seemed to get the job done.
My Blog | My Setup | My Videos | Have a wonderful day.
#14
no.. what if the images i uploaded is on the local folder only..? like inside the image folder i created inside the debug folder? how can i save the image path to the database and retrieve it to the database to show it in picture box? so how am i gonna do that? can you show me some example please to better understand?
#15
If they are on the local folder only, then simply save a MySQL Field containing the file name for each student, then load that picture!
My Blog | My Setup | My Videos | Have a wonderful day.
#16
that's my problem <!-- sCry --><img src="{SMILIES_PATH}/icon_cry.gif" alt="Cry" title="Crying or Very Sad" /><!-- sCry --> i don't know how to code that.. <!-- s:oops: --><img src="{SMILIES_PATH}/icon_redface.gif" alt=":oops:" title="Embarrassed" /><!-- s:oops: -->
maybe if you could demonstrate a tutorial to do that.. i appreciate it very much..
#17
i need it so badly.. <!-- sCry --><img src="{SMILIES_PATH}/icon_cry.gif" alt="Cry" title="Crying or Very Sad" /><!-- sCry -->
#18
Which part do you need help coding? The MySQL part? The reading pictures from a file part?
My Blog | My Setup | My Videos | Have a wonderful day.
#19
reading pictures from a file path..
#20
Ah, well this should help you out! This code loads a picture from the filesystem and loads it into a picturebox!

[code2=vbnet]Dim picture As Image = _
Image.FromFile(My.Application.Info.DirectoryPath & "/images/picture.png")
PictureBox1.Image = picture[/code2]
My Blog | My Setup | My Videos | Have a wonderful day.


Forum Jump:


Users browsing this thread: 1 Guest(s)