Public Class Form1
'Webcam
Public Touchless As New TouchlessLib.TouchlessMgr
Public Camera1 As TouchlessLib.Camera = Touchless.Cameras.ElementAt(1)
Public Camera2 As TouchlessLib.Camera = Touchless.Cameras.ElementAt(0)
Private Sub Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
PictureBox3.Image = Touchless.Cameras.ElementAt(1).GetCurrentImage
PictureBox4.Image = Touchless.Cameras.ElementAt(0).GetCurrentImage
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Touchless.CurrentCamera = Camera1
Touchless.CurrentCamera.CaptureHeight = 250
Touchless.CurrentCamera.CaptureWidth = 300
Touchless.CurrentCamera = Camera2
Touchless.CurrentCamera.CaptureHeight = 250
Touchless.CurrentCamera.CaptureWidth = 300
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
PictureBox1.Image = Touchless.Cameras.ElementAt(1).GetCurrentImage
PictureBox2.Image = Touchless.Cameras.ElementAt(0).GetCurrentImage
End Sub
' Save the picture.
Private Sub Button2_Click(ByVal sender As _
System.Object, ByVal e As System.EventArgs) Handles _
Button2.Click
' Compose the picture's base file name.
Dim file_name As String = Application.ExecutablePath
file_name = file_name.Substring(0, _
file_name.LastIndexOf("\bin")) & _
"\test."
' Get a Bitmap.
Dim bm As Bitmap = PictureBox4.Image
' Save the picture as a bitmap, JPEG, and GIF.
bm.Save(file_name & "bmp", _
System.Drawing.Imaging.ImageFormat.Bmp)
bm.Save(file_name & "jpg", _
System.Drawing.Imaging.ImageFormat.Jpeg)
bm.Save(file_name & "gif", _
System.Drawing.Imaging.ImageFormat.Gif)
MsgBox("Ok")
End Sub
In the above code, i want to save image to a c:/ drive with a custom file name and with replace of default folder "\bin" and name "\test." in the above code...what is the correct code to save image with custom destination & file name option..?
Thank U