Hi guys. The below code saves the video into specific folder and specific name. I would like to replace
to
method so that the user can save the video into any folder and any file name they want. Can anyone please guide me, I'm new to this. Your help is much appreciated.
Code:
Dim destination As String = "C:\Users\Emily\Desktop\Video.mpg"
Code:
savefiledialog
Code:
Imports Emgu.CV
Imports Emgu.Util
Imports Emgu.CV.Structure
Imports System.IO
Imports System.IO.Ports
Public Class Form2
Dim Capturez As Capture = New Capture(0)
Dim Videoz As VideoWriter
Dim imagez As Image(Of Bgr, Byte)
Private Sub Form2_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Me.WindowState = System.Windows.Forms.FormWindowState.Maximized
Dim destination As String = "C:\Users\Emily\Desktop\Video.mpg"
Dim compression As Integer = CvInvoke.CV_FOURCC("D", "I", "V", "X")
Dim fps As Integer = 9.5
Dim width As Integer = 640
Dim height As Integer = 480
Dim color As Boolean = True
Videoz = New VideoWriter(destination, compression, fps, width, height, color)
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
imagez = Capturez.QueryFrame().Flip(Emgu.CV.CvEnum.FLIP.HORIZONTAL)
PictureBox1.Image = imagez.ToBitmap()
End Sub
Private Sub Timer2_Tick(sender As Object, e As EventArgs) Handles Timer2.Tick
Videoz.WriteFrame(imagez)
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Timer1.Start()
Timer2.Start()
End Sub
Private Sub Button2_Click_1(sender As Object, e As EventArgs) Handles Button2.Click
Timer2.Stop()
End Sub
End Class