13 Replies - 3082 Views - Last Post: 15 November 2012 - 11:23 PM Rate Topic: -----

#1 royalopez06  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 31-October 12

Display image in picturebox after the other

Posted 09 November 2012 - 06:23 AM

When i click a button, a webcam captures an image and display it to picturebox1. What i want is, if I click the capture button it will display it in picturebox1, when i click again, it will display in picturebox2, until picturebox4, something like this:
Image = A, B, C, D
click: [A] [ ] [ ] [ ]
click: [A] [B] [ ] [ ]
click: [A] [B] [C] [ ]
click: [A] [B] [C] [D] after displaying four images, pictureboxes will be set to nothing and start over again...
click: [A] [ ] [ ] [ ]
click: [A] [B] [ ] [ ]
click: [A] [B] [C] [ ]
click: [A] [B] [C] [D] and so on...

I don't know how to code this, someone please help.

I have already the code of capturing images from youtube. Thanks.

Is This A Good Question/Topic? 0
  • +

Replies To: Display image in picturebox after the other

#2 coder3788  Icon User is offline

  • D.I.C Head

Reputation: 38
  • View blog
  • Posts: 62
  • Joined: 06-November 12

Re: Display image in picturebox after the other

Posted 09 November 2012 - 07:17 AM

View Postroyalopez06, on 09 November 2012 - 06:23 AM, said:

When i click a button, a webcam captures an image and display it to picturebox1. What i want is, if I click the capture button it will display it in picturebox1, when i click again, it will display in picturebox2


Find the piece of code that does it for picturebox1 and adapt it to the other pictureboxes.
Something like
 picturebox1.Image = [whatever] 

Was This Post Helpful? 0
  • +
  • -

#3 royalopez06  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 31-October 12

Re: Display image in picturebox after the other

Posted 10 November 2012 - 06:47 AM

when i do something like this

select case x
case 0
picturebox1.image = jpeg
case 1
picturebox2.image = jpeg
case 2
picturebox3.image = jpeg
case 3
picturebox4.image = jpeg
end case

it will display the same image in the picturebox 1 to 4 all at the same time.
Was This Post Helpful? 0
  • +
  • -

#4 zeeshanef  Icon User is offline

  • D.I.C Head

Reputation: 17
  • View blog
  • Posts: 71
  • Joined: 14-April 12

Re: Display image in picturebox after the other

Posted 10 November 2012 - 08:41 AM

you can check if picturebox is nothing then attack image like:
If (PictureBox1.Image Is Nothing) Then
   PictureBox1.Image = jpeg

ElseIf (PictureBox2.Image Is Nothing) Then
   PictureBox2.Image = jpeg

'and so on


Was This Post Helpful? 1
  • +
  • -

#5 royalopez06  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 31-October 12

Re: Display image in picturebox after the other

Posted 12 November 2012 - 01:00 AM

Thank you zeeshaneef, it helps a lot...
Was This Post Helpful? 0
  • +
  • -

#6 royalopez06  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 31-October 12

Re: Display image in picturebox after the other

Posted 12 November 2012 - 05:23 AM

how can I set pictureboxes to nothing without displaying the 5th picture after displaying 4 images.

If (PictureBox1.Image Is Nothing) Then
PictureBox1.Image = jpeg
ElseIf (PictureBox2.Image Is Nothing) Then
PictureBox2.Image = jpeg
ElseIf (PictureBox3.Image Is Nothing) Then
PictureBox3.Image = jpeg
ElseIf (PictureBox4.Image Is Nothing) Then
PictureBox4.Image = jpeg
else
PictureBox1.Image = Nothing
PictureBox2.Image = Nothing
PictureBox3.Image = Nothing
PictureBox4.Image = Nothing
End if
Was This Post Helpful? 0
  • +
  • -

#7 zeeshanef  Icon User is offline

  • D.I.C Head

Reputation: 17
  • View blog
  • Posts: 71
  • Joined: 14-April 12

Re: Display image in picturebox after the other

Posted 12 November 2012 - 07:55 AM

you can check all (4) pictureboxes like following, and assign Nothing, if all PictureBox containing image.

If (PictureBox1.Image IsNot Nothing AndAlso PictureBox2.Image IsNot Nothing AndAlso PictureBox3.Image IsNot Nothing AndAlso PictureBox4.Image IsNot Nothing) Then
           PictureBox1.Image = Nothing
           PictureBox2.Image = Nothing
           PictureBox3.Image = Nothing
           PictureBox4.Image = Nothing
 End If


            If (PictureBox1.Image Is Nothing) Then
                PictureBox1.Image = jpg                

            ElseIf (PictureBox2.Image Is Nothing) Then
                PictureBox2.Image = jpg                

            ElseIf (PictureBox3.Image Is Nothing) Then
                PictureBox3.Image = jpg                

            ElseIf (PictureBox4.Image Is Nothing) Then
                PictureBox4.Image = jpg                
            End If



And no need to use Else section of IF statement.

This post has been edited by zeeshanef: 12 November 2012 - 08:03 AM

Was This Post Helpful? 1
  • +
  • -

#8 royalopez06  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 31-October 12

Re: Display image in picturebox after the other

Posted 12 November 2012 - 05:25 PM

Thanks again, sir.
Was This Post Helpful? 0
  • +
  • -

#9 royalopez06  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 31-October 12

Re: Display image in picturebox after the other

Posted 14 November 2012 - 05:55 AM

how about I click the button only once, then picture capture will continuously take picture until it completes all 4 picture boxes, then that's the time click event will stop.
Was This Post Helpful? 0
  • +
  • -

#10 zeeshanef  Icon User is offline

  • D.I.C Head

Reputation: 17
  • View blog
  • Posts: 71
  • Joined: 14-April 12

Re: Display image in picturebox after the other

Posted 14 November 2012 - 07:53 AM

Please see this:
http://www.dreaminco...-picture-boxes/
Was This Post Helpful? 0
  • +
  • -

#11 royalopez06  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 31-October 12

Re: Display image in picturebox after the other

Posted 15 November 2012 - 05:04 AM

Sorry, but i don't understand C# language.
Was This Post Helpful? 0
  • +
  • -

#12 royalopez06  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 31-October 12

Re: Display image in picturebox after the other

Posted 15 November 2012 - 05:23 AM

Dim MyFrame(3) As PictureBox
   MyFrame(0) = PictureBox1
   MyFrame(1) = PictureBox2
   MyFrame(2) = PictureBox3  
   MyFrame(3) = PictureBox4

If (PictureBox1.Image IsNot Nothing AndAlso PictureBox2.Image IsNot    Nothing AndAlso PictureBox3.Image IsNot Nothing AndAlso PictureBox4.Image IsNot Nothing) Then
   PictureBox1.Image = Nothing
   PictureBox2.Image = Nothing
   PictureBox3.Image = Nothing
   PictureBox4.Image = Nothing
End If

for i = 0 to MyFrame.length - 1
If (MyFrame(i).Image Is Nothing) Then
   MyFrame(i).Image = jpeg
   ElseIf (MyFrame(i).Image Is Nothing) Then
      MyFrame(i).Image = jpeg
   ElseIf (MyFrame(i).Image Is Nothing) Then
      MyFrame(i).Image = jpeg
   ElseIf (MyFrame(i).Image Is Nothing) Then
      MyFrame(i).Image = jpeg
End if 
Next



Please help me with my code.
Was This Post Helpful? 0
  • +
  • -

#13 lucky3  Icon User is offline

  • Friend lucky3 As IHelpable
  • member icon

Reputation: 231
  • View blog
  • Posts: 765
  • Joined: 19-October 11

Re: Display image in picturebox after the other

Posted 15 November 2012 - 05:30 AM

It's been 6 days now, since you started this topic. Why don't you take a "VB.NET in 30 days" type of book in your hands, and try to understand what's going on. zeeshanef here is doing your work, and that is not the way to become programmer.

Learn how to debug, how to understand error messages, and stop posting "please help" type of vague requests/questions. Come with concrete problem, and you'll get tons of help.
Was This Post Helpful? 0
  • +
  • -

#14 royalopez06  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 31-October 12

Re: Display image in picturebox after the other

Posted 15 November 2012 - 11:23 PM

Thank you for the help, I get it already I just use this code.
If (PictureBox1.Image IsNot Nothing AndAlso PictureBox2.Image IsNot    Nothing AndAlso PictureBox3.Image IsNot Nothing AndAlso PictureBox4.Image IsNot Nothing) Then
   Exit sub
Else
   CounterForm.show()
Then


Was This Post Helpful? 0
  • +
  • -

Page 1 of 1