How do I save multiple pictures as different file names vb.net? -


I want to capture pictures with a video screen shot and want to store them in a file. As the videos will run many screen shots and we will all be stored in the image file. My problem is every time when I save my picture, the previous image has been captured. Thus, instead of leaving a stream of images in the end, I avoid avoiding the show file dialog because I want the image to be automatically stored.

Bmp.Save ("C: \ users \ pnasguna \ Desktop \ A \"

This code should be written to file A when the program goes to the loop:

 .png ", System.Drawing.Imaging.ImageFormat.Png)  

I like to get a result: A1.png, A2.png, A3.png,. .. a .png

Please guide me Thank you for the following is my current code:

  If mati = 2 then Bmp.Save ("C: \ users \ Pnasguna \ Desktop \ A.png ", System.Drawing.Imaging.ImageFormat.png) ElseIf mati = 5 then Bmp.Save (" C: \ Users \ pnasguna \ Desktop \ A1.png ", System.Drawing.Imaging.ImageFormat .PNG) ElseIf mati = 8 then Bmp.Save ("C: \ Users \ Pnasguna \ Desktop \ A2.png ", System.Drawing.Imaging.ImageFormat.Png) ElseIf mati = 11 then Bmp.Save (" C: \ Users \ pnasguna \ Desktop \ A3.png ", System.Drawing.Imaging. ImageFormat.Png) ElseIf mati = 14 Then Bmp.Save ("C: \ Users \ pnasguna \ Desktop \ A4.png", System.Drawing.Imaging.ImageFormat.Png) ElseIf mati = 18 then Bmp.Save ("C: \ user \ pnasguna \ Desktop \ A5 .png ", System.Drawing.Imaging.ImageFormat.Png)  

The way the clay is a timer. Is it a fair way for me instead to create a new file name?

The reason for this is overwriting A.png because you repeat the same name again Are giving up.

It's easy to solve. What you can do -

  • Create a variable to keep the click count.

      / * int count = 1;  
  • Every time you enter the loop ( count + = 1 or as needed), update it.

  • Add it to your path

      BMP Save ("C: \ Users \ pnasguna \ Desktop \ A" & amp; Count & amp; ".png", System.Drawing.Imaging.ImageFormat.Png  

Edit If you already have a loop counter, you can use it, there is no need to create a new variable ( Unless you want it continuously, definitely).

Update

Sorry, my bad. & amp; / Strong> Not used for string combination +


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -