Imports System.Drawing.Imaging
Imports System.IO
Public Class ProCam
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents grpFile As System.Windows.Forms.GroupBox
Friend WithEvents buttonSave As System.Windows.Forms.Button
Friend WithEvents txtFileName As System.Windows.Forms.TextBox
Friend WithEvents grpDevice As System.Windows.Forms.GroupBox
Friend WithEvents lstDevices As System.Windows.Forms.ListBox
Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox
Friend WithEvents buttonStart As System.Windows.Forms.Button
Friend WithEvents buttonStop As System.Windows.Forms.Button
Friend WithEvents objPreview As System.Windows.Forms.PictureBox
Friend WithEvents sfdImage As System.Windows.Forms.SaveFileDialog
Friend WithEvents buttonGrab As System.Windows.Forms.Button
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(ProCam))
Me.sfdImage = New System.Windows.Forms.SaveFileDialog()
Me.statusStrip1 = New System.Windows.Forms.StatusStrip()
Me.lblStat = New System.Windows.Forms.ToolStripStatusLabel()
Me.contextMenuStrip1 = New System.Windows.Forms.ContextMenuStrip(Me.components)
Me.spegniWebCamToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.resettaWebCamToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.timer1 = New System.Windows.Forms.Timer(Me.components)
Me.ofdConvert = New System.Windows.Forms.OpenFileDialog()
Me.pagFrame = New System.Windows.Forms.TabPage()
Me.grpInfo = New System.Windows.Forms.GroupBox()
Me.lblAuthor = New System.Windows.Forms.Label()
Me.buttonContactMe = New System.Windows.Forms.Button()
Me.lblInfo = New System.Windows.Forms.Label()
Me.lblAppName = New System.Windows.Forms.Label()
Me.grpFPS = New System.Windows.Forms.GroupBox()
Me.lblNowFPS = New System.Windows.Forms.Label()
Me.buttonFPS = New System.Windows.Forms.Button()
Me.lblFPS = New System.Windows.Forms.Label()
Me.txtFPS = New System.Windows.Forms.TextBox()
Me.grpConvert = New System.Windows.Forms.GroupBox()
Me.buttonOpenNewFile = New System.Windows.Forms.Button()
Me.lstConvert = New System.Windows.Forms.ListBox()
Me.buttonConvert = New System.Windows.Forms.Button()
Me.buttonOpen = New System.Windows.Forms.Button()
Me.txtConvert = New System.Windows.Forms.TextBox()
Me.grpFile = New System.Windows.Forms.GroupBox()
Me.buttonGrab = New System.Windows.Forms.Button()
Me.buttonSave = New System.Windows.Forms.Button()
Me.txtFileName = New System.Windows.Forms.TextBox()
Me.pagWebCam = New System.Windows.Forms.TabPage()
Me.grpVideo = New System.Windows.Forms.GroupBox()
Me.buttonFileNameVideo = New System.Windows.Forms.Button()
Me.txtVideo = New System.Windows.Forms.TextBox()
Me.buttonStopVideo = New System.Windows.Forms.Button()
Me.buttonPlay = New System.Windows.Forms.Button()
Me.objPreview = New System.Windows.Forms.PictureBox()
Me.GroupBox2 = New System.Windows.Forms.GroupBox()
Me.buttonRefresh = New System.Windows.Forms.Button()
Me.buttonStart = New System.Windows.Forms.Button()
Me.buttonStop = New System.Windows.Forms.Button()
Me.grpDevice = New System.Windows.Forms.GroupBox()
Me.lstDevices = New System.Windows.Forms.ListBox()
Me.tabControl1 = New System.Windows.Forms.TabControl()
Me.statusStrip1.SuspendLayout
Me.contextMenuStrip1.SuspendLayout
Me.pagFrame.SuspendLayout
Me.grpInfo.SuspendLayout
Me.grpFPS.SuspendLayout
Me.grpConvert.SuspendLayout
Me.grpFile.SuspendLayout
Me.pagWebCam.SuspendLayout
Me.grpVideo.SuspendLayout
CType(Me.objPreview,System.ComponentModel.ISupportInitialize).BeginInit
Me.GroupBox2.SuspendLayout
Me.grpDevice.SuspendLayout
Me.tabControl1.SuspendLayout
Me.SuspendLayout
'
'sfdImage
'
Me.sfdImage.CheckPathExists = false
Me.sfdImage.FileName = "HellImage.bmp"
Me.sfdImage.Filter = "Immagine BMP|*.bmp|Video .avi|*.avi"
'
'statusStrip1
'
Me.statusStrip1.BackColor = System.Drawing.Color.LightSteelBlue
Me.statusStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.lblStat})
Me.statusStrip1.Location = New System.Drawing.Point(0, 277)
Me.statusStrip1.Name = "statusStrip1"
Me.statusStrip1.Size = New System.Drawing.Size(574, 22)
Me.statusStrip1.TabIndex = 2
Me.statusStrip1.Text = "statusStrip1"
'
'lblStat
'
Me.lblStat.BackColor = System.Drawing.Color.Transparent
Me.lblStat.Name = "lblStat"
Me.lblStat.Size = New System.Drawing.Size(0, 17)
'
'contextMenuStrip1
'
Me.contextMenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.spegniWebCamToolStripMenuItem, Me.resettaWebCamToolStripMenuItem})
Me.contextMenuStrip1.Name = "contextMenuStrip1"
Me.contextMenuStrip1.ShowImageMargin = false
Me.contextMenuStrip1.Size = New System.Drawing.Size(145, 48)
'
'spegniWebCamToolStripMenuItem
'
Me.spegniWebCamToolStripMenuItem.Name = "spegniWebCamToolStripMenuItem"
Me.spegniWebCamToolStripMenuItem.Size = New System.Drawing.Size(144, 22)
Me.spegniWebCamToolStripMenuItem.Text = "Spegni WebCam"
AddHandler Me.spegniWebCamToolStripMenuItem.Click, AddressOf Me.SpegniWebCamToolStripMenuItemClick
'
'resettaWebCamToolStripMenuItem
'
Me.resettaWebCamToolStripMenuItem.Name = "resettaWebCamToolStripMenuItem"
Me.resettaWebCamToolStripMenuItem.Size = New System.Drawing.Size(144, 22)
Me.resettaWebCamToolStripMenuItem.Text = "Resetta WebCam"
AddHandler Me.resettaWebCamToolStripMenuItem.Click, AddressOf Me.ResettaWebCamToolStripMenuItemClick
'
'timer1
'
Me.timer1.Enabled = true
AddHandler Me.timer1.Tick, AddressOf Me.Timer1Tick
'
'ofdConvert
'
Me.ofdConvert.Filter = "Immagine BMP|*.bmp"
'
'pagFrame
'
Me.pagFrame.BackColor = System.Drawing.SystemColors.GradientInactiveCaption
Me.pagFrame.Controls.Add(Me.grpInfo)
Me.pagFrame.Controls.Add(Me.grpFPS)
Me.pagFrame.Controls.Add(Me.grpConvert)
Me.pagFrame.Controls.Add(Me.grpFile)
Me.pagFrame.Location = New System.Drawing.Point(4, 22)
Me.pagFrame.Name = "pagFrame"
Me.pagFrame.Padding = New System.Windows.Forms.Padding(3)
Me.pagFrame.Size = New System.Drawing.Size(566, 248)
Me.pagFrame.TabIndex = 1
Me.pagFrame.Text = "Frame"
'
'grpInfo
'
Me.grpInfo.Controls.Add(Me.lblAuthor)
Me.grpInfo.Controls.Add(Me.buttonContactMe)
Me.grpInfo.Controls.Add(Me.lblInfo)
Me.grpInfo.Controls.Add(Me.lblAppName)
Me.grpInfo.Location = New System.Drawing.Point(6, 95)
Me.grpInfo.Name = "grpInfo"
Me.grpInfo.Size = New System.Drawing.Size(265, 150)
Me.grpInfo.TabIndex = 14
Me.grpInfo.TabStop = false
Me.grpInfo.Text = "Informazioni : "
'
'lblAuthor
'
Me.lblAuthor.Font = New System.Drawing.Font("Stencil", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0,Byte))
Me.lblAuthor.ForeColor = System.Drawing.Color.Navy
Me.lblAuthor.Location = New System.Drawing.Point(8, 124)
Me.lblAuthor.Name = "lblAuthor"
Me.lblAuthor.Size = New System.Drawing.Size(170, 23)
Me.lblAuthor.TabIndex = 3
Me.lblAuthor.Text = "Realizzato da Lollo 97."
'
'buttonContactMe
'
Me.buttonContactMe.BackColor = System.Drawing.Color.White
Me.buttonContactMe.Location = New System.Drawing.Point(184, 120)
Me.buttonContactMe.Name = "buttonContactMe"
Me.buttonContactMe.Size = New System.Drawing.Size(75, 27)
Me.buttonContactMe.TabIndex = 2
Me.buttonContactMe.Text = "Contattami"
Me.buttonContactMe.UseVisualStyleBackColor = false
AddHandler Me.buttonContactMe.Click, AddressOf Me.ButtonContactMeClick
'
'lblInfo
'
Me.lblInfo.Location = New System.Drawing.Point(8, 33)
Me.lblInfo.Name = "lblInfo"
Me.lblInfo.Size = New System.Drawing.Size(251, 86)
Me.lblInfo.TabIndex = 1
Me.lblInfo.Text = resources.GetString("lblInfo.Text")
'
'lblAppName
'
Me.lblAppName.Font = New System.Drawing.Font("Lucida Calligraphy", 12!, CType((System.Drawing.FontStyle.Bold Or System.Drawing.FontStyle.Italic),System.Drawing.FontStyle), System.Drawing.GraphicsUnit.Point, CType(0,Byte))
Me.lblAppName.ForeColor = System.Drawing.Color.RoyalBlue
Me.lblAppName.Location = New System.Drawing.Point(63, 10)
Me.lblAppName.Name = "lblAppName"
Me.lblAppName.Size = New System.Drawing.Size(100, 23)
Me.lblAppName.TabIndex = 0
Me.lblAppName.Text = "ProCam"
'
'grpFPS
'
Me.grpFPS.Controls.Add(Me.lblNowFPS)
Me.grpFPS.Controls.Add(Me.buttonFPS)
Me.grpFPS.Controls.Add(Me.lblFPS)
Me.grpFPS.Controls.Add(Me.txtFPS)
Me.grpFPS.Location = New System.Drawing.Point(277, 152)
Me.grpFPS.Name = "grpFPS"
Me.grpFPS.Size = New System.Drawing.Size(286, 93)
Me.grpFPS.TabIndex = 13
Me.grpFPS.TabStop = false
Me.grpFPS.Text = "Frame per Second (FPS)"
'
'lblNowFPS
'
Me.lblNowFPS.Location = New System.Drawing.Point(6, 67)
Me.lblNowFPS.Name = "lblNowFPS"
Me.lblNowFPS.Size = New System.Drawing.Size(193, 23)
Me.lblNowFPS.TabIndex = 3
'
'buttonFPS
'
Me.buttonFPS.BackColor = System.Drawing.Color.White
Me.buttonFPS.Location = New System.Drawing.Point(208, 35)
Me.buttonFPS.Name = "buttonFPS"
Me.buttonFPS.Size = New System.Drawing.Size(75, 27)
Me.buttonFPS.TabIndex = 2
Me.buttonFPS.Text = "Imposta"
Me.buttonFPS.UseVisualStyleBackColor = false
AddHandler Me.buttonFPS.Click, AddressOf Me.ButtonFPSClick
'
'lblFPS
'
Me.lblFPS.Location = New System.Drawing.Point(6, 13)
Me.lblFPS.Name = "lblFPS"
Me.lblFPS.Size = New System.Drawing.Size(193, 23)
Me.lblFPS.TabIndex = 1
Me.lblFPS.Text = "Inserisci i Frame per secondo (FPS) : "
'
'txtFPS
'
Me.txtFPS.Location = New System.Drawing.Point(6, 39)
Me.txtFPS.Name = "txtFPS"
Me.txtFPS.Size = New System.Drawing.Size(193, 20)
Me.txtFPS.TabIndex = 0
'
'grpConvert
'
Me.grpConvert.Controls.Add(Me.buttonOpenNewFile)
Me.grpConvert.Controls.Add(Me.lstConvert)
Me.grpConvert.Controls.Add(Me.buttonConvert)
Me.grpConvert.Controls.Add(Me.buttonOpen)
Me.grpConvert.Controls.Add(Me.txtConvert)
Me.grpConvert.Location = New System.Drawing.Point(277, 6)
Me.grpConvert.Name = "grpConvert"
Me.grpConvert.Size = New System.Drawing.Size(286, 143)
Me.grpConvert.TabIndex = 12
Me.grpConvert.TabStop = false
Me.grpConvert.Text = "Converti"
'
'buttonOpenNewFile
'
Me.buttonOpenNewFile.Enabled = false
Me.buttonOpenNewFile.Location = New System.Drawing.Point(176, 107)
Me.buttonOpenNewFile.Name = "buttonOpenNewFile"
Me.buttonOpenNewFile.Size = New System.Drawing.Size(77, 27)
Me.buttonOpenNewFile.TabIndex = 15
Me.buttonOpenNewFile.Text = "Apri il File"
Me.buttonOpenNewFile.UseVisualStyleBackColor = true
AddHandler Me.buttonOpenNewFile.Click, AddressOf Me.ButtonOpenNewFileClick
'
'lstConvert
'
Me.lstConvert.BackColor = System.Drawing.SystemColors.Window
Me.lstConvert.Items.AddRange(New Object() {".jpeg", ".png", ".gif"})
Me.lstConvert.Location = New System.Drawing.Point(8, 78)
Me.lstConvert.Name = "lstConvert"
Me.lstConvert.Size = New System.Drawing.Size(162, 56)
Me.lstConvert.TabIndex = 14
'
'buttonConvert
'
Me.buttonConvert.BackColor = System.Drawing.Color.White
Me.buttonConvert.Enabled = false
Me.buttonConvert.FlatAppearance.MouseOverBackColor = System.Drawing.Color.LightGray
Me.buttonConvert.Location = New System.Drawing.Point(108, 45)
Me.buttonConvert.Name = "buttonConvert"
Me.buttonConvert.Size = New System.Drawing.Size(145, 27)
Me.buttonConvert.TabIndex = 12
Me.buttonConvert.Text = "Converti il File .bmp in..."
Me.buttonConvert.UseVisualStyleBackColor = false
AddHandler Me.buttonConvert.Click, AddressOf Me.ButtonConvertClick
'
'buttonOpen
'
Me.buttonOpen.BackColor = System.Drawing.Color.White
Me.buttonOpen.FlatAppearance.MouseOverBackColor = System.Drawing.Color.LightGray
Me.buttonOpen.Location = New System.Drawing.Point(8, 45)
Me.buttonOpen.Name = "buttonOpen"
Me.buttonOpen.Size = New System.Drawing.Size(75, 27)
Me.buttonOpen.TabIndex = 11
Me.buttonOpen.Text = "Scegli"
Me.buttonOpen.UseVisualStyleBackColor = false
AddHandler Me.buttonOpen.Click, AddressOf Me.ButtonOpenClick
'
'txtConvert
'
Me.txtConvert.Location = New System.Drawing.Point(8, 19)
Me.txtConvert.Name = "txtConvert"
Me.txtConvert.Size = New System.Drawing.Size(245, 20)
Me.txtConvert.TabIndex = 10
'
'grpFile
'
Me.grpFile.BackColor = System.Drawing.Color.Transparent
Me.grpFile.Controls.Add(Me.buttonGrab)
Me.grpFile.Controls.Add(Me.buttonSave)
Me.grpFile.Controls.Add(Me.txtFileName)
Me.grpFile.Location = New System.Drawing.Point(6, 6)
Me.grpFile.Name = "grpFile"
Me.grpFile.Size = New System.Drawing.Size(265, 83)
Me.grpFile.TabIndex = 10
Me.grpFile.TabStop = false
Me.grpFile.Text = "File Immagine"
'
'buttonGrab
'
Me.buttonGrab.BackColor = System.Drawing.Color.White
Me.buttonGrab.Enabled = false
Me.buttonGrab.FlatAppearance.MouseOverBackColor = System.Drawing.Color.LightGray
Me.buttonGrab.Location = New System.Drawing.Point(106, 48)
Me.buttonGrab.Name = "buttonGrab"
Me.buttonGrab.Size = New System.Drawing.Size(145, 27)
Me.buttonGrab.TabIndex = 9
Me.buttonGrab.Text = "Cattura Frame WebCam"
Me.buttonGrab.UseVisualStyleBackColor = false
AddHandler Me.buttonGrab.Click, AddressOf Me.ButtonGrabClick
'
'buttonSave
'
Me.buttonSave.BackColor = System.Drawing.Color.White
Me.buttonSave.Enabled = false
Me.buttonSave.FlatAppearance.MouseOverBackColor = System.Drawing.Color.LightGray
Me.buttonSave.Location = New System.Drawing.Point(8, 48)
Me.buttonSave.Name = "buttonSave"
Me.buttonSave.Size = New System.Drawing.Size(75, 27)
Me.buttonSave.TabIndex = 1
Me.buttonSave.Text = "Scegli"
Me.buttonSave.UseVisualStyleBackColor = false
'
'txtFileName
'
Me.txtFileName.Enabled = false
Me.txtFileName.Location = New System.Drawing.Point(6, 19)
Me.txtFileName.Name = "txtFileName"
Me.txtFileName.Size = New System.Drawing.Size(245, 20)
Me.txtFileName.TabIndex = 0
'
'pagWebCam
'
Me.pagWebCam.BackColor = System.Drawing.SystemColors.GradientInactiveCaption
Me.pagWebCam.Controls.Add(Me.grpVideo)
Me.pagWebCam.Controls.Add(Me.objPreview)
Me.pagWebCam.Controls.Add(Me.GroupBox2)
Me.pagWebCam.Controls.Add(Me.grpDevice)
Me.pagWebCam.Location = New System.Drawing.Point(4, 22)
Me.pagWebCam.Name = "pagWebCam"
Me.pagWebCam.Padding = New System.Windows.Forms.Padding(3)
Me.pagWebCam.Size = New System.Drawing.Size(566, 248)
Me.pagWebCam.TabIndex = 0
Me.pagWebCam.Text = "WebCam"
'
'grpVideo
'
Me.grpVideo.Controls.Add(Me.buttonFileNameVideo)
Me.grpVideo.Controls.Add(Me.txtVideo)
Me.grpVideo.Controls.Add(Me.buttonStopVideo)
Me.grpVideo.Controls.Add(Me.buttonPlay)
Me.grpVideo.Location = New System.Drawing.Point(314, 114)
Me.grpVideo.Name = "grpVideo"
Me.grpVideo.Size = New System.Drawing.Size(249, 65)
Me.grpVideo.TabIndex = 15
Me.grpVideo.TabStop = false
Me.grpVideo.Text = "Video"
'
'buttonFileNameVideo
'
Me.buttonFileNameVideo.BackColor = System.Drawing.Color.White
Me.buttonFileNameVideo.FlatAppearance.MouseOverBackColor = System.Drawing.Color.LightGray
Me.buttonFileNameVideo.Location = New System.Drawing.Point(168, 35)
Me.buttonFileNameVideo.Name = "buttonFileNameVideo"
Me.buttonFileNameVideo.Size = New System.Drawing.Size(75, 27)
Me.buttonFileNameVideo.TabIndex = 3
Me.buttonFileNameVideo.Text = "Scegli"
Me.buttonFileNameVideo.UseVisualStyleBackColor = true
AddHandler Me.buttonFileNameVideo.Click, AddressOf Me.ButtonFileNameVideoClick
'
'txtVideo
'
Me.txtVideo.Location = New System.Drawing.Point(6, 13)
Me.txtVideo.Name = "txtVideo"
Me.txtVideo.Size = New System.Drawing.Size(240, 20)
Me.txtVideo.TabIndex = 2
'
'buttonStopVideo
'
Me.buttonStopVideo.Image = CType(resources.GetObject("buttonStopVideo.Image"),System.Drawing.Image)
Me.buttonStopVideo.Location = New System.Drawing.Point(59, 35)
Me.buttonStopVideo.Name = "buttonStopVideo"
Me.buttonStopVideo.Size = New System.Drawing.Size(47, 27)
Me.buttonStopVideo.TabIndex = 1
Me.buttonStopVideo.UseVisualStyleBackColor = true
AddHandler Me.buttonStopVideo.Click, AddressOf Me.ButtonStopVideoClick
'
'buttonPlay
'
Me.buttonPlay.Image = CType(resources.GetObject("buttonPlay.Image"),System.Drawing.Image)
Me.buttonPlay.Location = New System.Drawing.Point(6, 35)
Me.buttonPlay.Name = "buttonPlay"
Me.buttonPlay.Size = New System.Drawing.Size(47, 27)
Me.buttonPlay.TabIndex = 0
Me.buttonPlay.UseVisualStyleBackColor = true
AddHandler Me.buttonPlay.Click, AddressOf Me.ButtonPlayClick
'
'objPreview
'
Me.objPreview.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right),System.Windows.Forms.AnchorStyles)
Me.objPreview.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
Me.objPreview.Location = New System.Drawing.Point(0, 0)
Me.objPreview.Name = "objPreview"
Me.objPreview.Size = New System.Drawing.Size(311, 245)
Me.objPreview.TabIndex = 0
Me.objPreview.TabStop = false
'
'GroupBox2
'
Me.GroupBox2.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right),System.Windows.Forms.AnchorStyles)
Me.GroupBox2.BackColor = System.Drawing.Color.Transparent
Me.GroupBox2.Controls.Add(Me.buttonRefresh)
Me.GroupBox2.Controls.Add(Me.buttonStart)
Me.GroupBox2.Controls.Add(Me.buttonStop)
Me.GroupBox2.Location = New System.Drawing.Point(314, 182)
Me.GroupBox2.Name = "GroupBox2"
Me.GroupBox2.Size = New System.Drawing.Size(249, 60)
Me.GroupBox2.TabIndex = 12
Me.GroupBox2.TabStop = false
Me.GroupBox2.Text = "Frame WebCam"
'
'buttonRefresh
'
Me.buttonRefresh.BackColor = System.Drawing.Color.White
Me.buttonRefresh.FlatAppearance.MouseOverBackColor = System.Drawing.Color.LightGray
Me.buttonRefresh.Location = New System.Drawing.Point(87, 16)
Me.buttonRefresh.Name = "buttonRefresh"
Me.buttonRefresh.Size = New System.Drawing.Size(75, 27)
Me.buttonRefresh.TabIndex = 8
Me.buttonRefresh.Text = "Reset"
Me.buttonRefresh.UseVisualStyleBackColor = true
AddHandler Me.buttonRefresh.Click, AddressOf Me.ButtonRefreshClick
'
'buttonStart
'
Me.buttonStart.BackColor = System.Drawing.Color.White
Me.buttonStart.Enabled = false
Me.buttonStart.FlatAppearance.MouseOverBackColor = System.Drawing.Color.LightGray
Me.buttonStart.Location = New System.Drawing.Point(3, 16)
Me.buttonStart.Name = "buttonStart"
Me.buttonStart.Size = New System.Drawing.Size(75, 27)
Me.buttonStart.TabIndex = 5
Me.buttonStart.Text = "Avvia"
Me.buttonStart.UseVisualStyleBackColor = true
AddHandler Me.buttonStart.Click, AddressOf Me.ButtonStartClick
'
'buttonStop
'
Me.buttonStop.BackColor = System.Drawing.Color.White
Me.buttonStop.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.buttonStop.Enabled = false
Me.buttonStop.FlatAppearance.MouseOverBackColor = System.Drawing.Color.LightGray
Me.buttonStop.Location = New System.Drawing.Point(168, 16)
Me.buttonStop.Name = "buttonStop"
Me.buttonStop.Size = New System.Drawing.Size(75, 27)
Me.buttonStop.TabIndex = 7
Me.buttonStop.Text = "Ferma"
Me.buttonStop.UseVisualStyleBackColor = true
AddHandler Me.buttonStop.Click, AddressOf Me.ButtonStopClick
'
'grpDevice
'
Me.grpDevice.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right),System.Windows.Forms.AnchorStyles)
Me.grpDevice.BackColor = System.Drawing.Color.Transparent
Me.grpDevice.Controls.Add(Me.lstDevices)
Me.grpDevice.Location = New System.Drawing.Point(314, 0)
Me.grpDevice.Name = "grpDevice"
Me.grpDevice.Size = New System.Drawing.Size(249, 108)
Me.grpDevice.TabIndex = 10
Me.grpDevice.TabStop = false
Me.grpDevice.Text = "Devices disponibili"
'
'lstDevices
'
Me.lstDevices.BackColor = System.Drawing.SystemColors.Window
Me.lstDevices.Dock = System.Windows.Forms.DockStyle.Fill
Me.lstDevices.Location = New System.Drawing.Point(3, 16)
Me.lstDevices.Name = "lstDevices"
Me.lstDevices.Size = New System.Drawing.Size(243, 89)
Me.lstDevices.TabIndex = 1
AddHandler Me.lstDevices.DoubleClick, AddressOf Me.LstDevicesDoubleClick
'
'tabControl1
'
Me.tabControl1.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right),System.Windows.Forms.AnchorStyles)
Me.tabControl1.Controls.Add(Me.pagWebCam)
Me.tabControl1.Controls.Add(Me.pagFrame)
Me.tabControl1.Location = New System.Drawing.Point(0, 0)
Me.tabControl1.Name = "tabControl1"
Me.tabControl1.SelectedIndex = 0
Me.tabControl1.Size = New System.Drawing.Size(574, 274)
Me.tabControl1.TabIndex = 1
'
'ProCam
'
Me.AcceptButton = Me.buttonStart
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.BackColor = System.Drawing.Color.LightSteelBlue
Me.CancelButton = Me.buttonStop
Me.ClientSize = New System.Drawing.Size(574, 299)
Me.ContextMenuStrip = Me.contextMenuStrip1
Me.Controls.Add(Me.statusStrip1)
Me.Controls.Add(Me.tabControl1)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D
Me.Icon = CType(resources.GetObject("$this.Icon"),System.Drawing.Icon)
Me.MaximizeBox = false
Me.Name = "ProCam"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "ProCam"
Me.TopMost = true
AddHandler FormClosing, AddressOf Me.ProCamFormClosing
AddHandler FormClosed, AddressOf Me.ProCamFormClosed
AddHandler Load, AddressOf Me.ProCamLoad
Me.statusStrip1.ResumeLayout(false)
Me.statusStrip1.PerformLayout
Me.contextMenuStrip1.ResumeLayout(false)
Me.pagFrame.ResumeLayout(false)
Me.grpInfo.ResumeLayout(false)
Me.grpFPS.ResumeLayout(false)
Me.grpFPS.PerformLayout
Me.grpConvert.ResumeLayout(false)
Me.grpConvert.PerformLayout
Me.grpFile.ResumeLayout(false)
Me.grpFile.PerformLayout
Me.pagWebCam.ResumeLayout(false)
Me.grpVideo.ResumeLayout(false)
Me.grpVideo.PerformLayout
CType(Me.objPreview,System.ComponentModel.ISupportInitialize).EndInit
Me.GroupBox2.ResumeLayout(false)
Me.grpDevice.ResumeLayout(false)
Me.tabControl1.ResumeLayout(false)
Me.ResumeLayout(false)
Me.PerformLayout
End Sub
Private lblInfo As System.Windows.Forms.Label
Private lblAuthor As System.Windows.Forms.Label
Private grpFPS As System.Windows.Forms.GroupBox
Private lblAppName As System.Windows.Forms.Label
Private buttonContactMe As System.Windows.Forms.Button
Friend lblNowFPS As System.Windows.Forms.Label
Friend txtFPS As System.Windows.Forms.TextBox
Friend lblFPS As System.Windows.Forms.Label
Private txtVideo As System.Windows.Forms.TextBox
Friend buttonFPS As System.Windows.Forms.Button
Private grpInfo As System.Windows.Forms.GroupBox
Friend buttonFileNameVideo As System.Windows.Forms.Button
Private buttonPlay As System.Windows.Forms.Button
Private buttonStopVideo As System.Windows.Forms.Button
Friend grpVideo As System.Windows.Forms.GroupBox
Private buttonOpenNewFile As System.Windows.Forms.Button
Friend lstConvert As System.Windows.Forms.ListBox
Friend txtConvert As System.Windows.Forms.TextBox
Private ofdConvert As System.Windows.Forms.OpenFileDialog
Friend buttonOpen As System.Windows.Forms.Button
Friend buttonConvert As System.Windows.Forms.Button
Friend grpConvert As System.Windows.Forms.GroupBox
Private timer1 As System.Windows.Forms.Timer
Private resettaWebCamToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Private spegniWebCamToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Private contextMenuStrip1 As System.Windows.Forms.ContextMenuStrip
Private lblStat As System.Windows.Forms.ToolStripStatusLabel
Friend statusStrip1 As System.Windows.Forms.StatusStrip
Friend buttonRefresh As System.Windows.Forms.Button
Private pagFrame As System.Windows.Forms.TabPage
Private pagWebCam As System.Windows.Forms.TabPage
Friend tabControl1 As System.Windows.Forms.TabControl
#End Region
Dim iDevice As String = Nothing
Dim WebCam As New iCam
Dim IsSaved As Boolean
Sub ProCamLoad(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
LoadDeviceList()
CheckDeviceList()
End Sub
Sub LoadDeviceList()
Dim strName As String = Space(100)
Dim strVer As String = Space(100)
Dim bReturn As Boolean
Dim x As Integer = 0
Do
bReturn = WebCam.capGetDriverDescriptionA(CShort(x), strName, 100, strVer, 100)
If bReturn Then lstDevices.Items.Add(strName.Trim)
x += 1
Loop Until bReturn = False
End Sub
Sub CheckDeviceList()
If lstDevices.Items.Count > 0 Then
lstDevices.SelectedIndex = 0
EnableForm()
buttonStop.Enabled = False
Else
lstDevices.Items.Add("Nessun device trovato")
End If
End Sub
Sub EnableForm()
txtFileName.Enabled = True
buttonSave.Enabled = True
buttonGrab.Enabled = True
buttonStop.Enabled = True
buttonStart.Enabled = True
buttonRefresh.Enabled = True
End Sub
Sub buttonStartClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles buttonStart.Click
iDevice = lstDevices.SelectedItem.ToString()
WebCam.initCam(objPreview.Handle.ToInt32,iDevice)
EnableForm()
End Sub
Sub buttonStopClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles buttonStop.Click
WebCam.CloseCam()
buttonStop.Enabled = False
buttonStart.Enabled = True
buttonGrab.Enabled = False
buttonRefresh.Enabled = False
End Sub
Sub buttonSaveClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles buttonSave.Click
If sfdImage.ShowDialog() = DialogResult.OK Then
txtFileName.Text = sfdImage.FileName
IsSaved = True
Else
IsSaved = False
End If
End Sub
Sub buttonGrabClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles buttonGrab.Click
If IsSaved Then
WebCam.SaveFrame(txtFileName.Text)
ElseIf MessageBox.Show("Non hai salvato in nessuna directory.Vuoi salvare ora?",
"ProCam",MessageBoxButtons.YesNo) = DialogResult.Yes Then
If sfdImage.ShowDialog() = DialogResult.OK Then
WebCam.SaveFrame(txtFileName.Text)
End If
End If
End Sub
Sub LstDevicesDoubleClick(sender As Object, e As EventArgs)
iDevice = lstDevices.SelectedItem.ToString()
WebCam.initCam(objPreview.Handle.ToInt32,iDevice)
EnableForm()
End Sub
Sub ButtonRefreshClick(sender As Object, e As EventArgs)
WebCam.resetCam()
End Sub
Sub SpegniWebCamToolStripMenuItemClick(sender As Object, e As EventArgs)
WebCam.CloseCam()
End Sub
Sub ResettaWebCamToolStripMenuItemClick(sender As Object, e As EventArgs)
WebCam.resetCam()
End Sub
Sub Timer1Tick(sender As Object, e As EventArgs)
lblStat.Text = WebCam.StatusString
lblNowFPS.Text = "Attuali FPS : " &WebCam.FPS()
End Sub
Sub ButtonOpenClick(sender As Object, e As EventArgs)
If ofdConvert.ShowDialog() = DialogResult.OK Then
txtConvert.Text = ofdConvert.FileName
buttonConvert.Enabled = True
lstConvert.Items.Clear()
lstConvert.Items.Add(IO.Path.GetFileNameWithoutExtension(txtConvert.Text) &".jpeg")
lstConvert.Items.Add(IO.Path.GetFileNameWithoutExtension(txtConvert.Text) &".png")
lstConvert.Items.Add(IO.Path.GetFileNameWithoutExtension(txtConvert.Text) &".gif")
End If
End Sub
Sub ButtonConvertClick(sender As Object, e As EventArgs)
If lstConvert.SelectedIndex = 0 Then
WebCam.ConvertBMP(txtConvert.Text,ImageFormat.Jpeg)
buttonOpenNewFile.Enabled = True
ElseIf lstConvert.SelectedIndex = 1 Then
WebCam.ConvertBMP(txtConvert.Text,ImageFormat.Png)
buttonOpenNewFile.Enabled = True
ElseIf lstConvert.SelectedIndex = 2 Then
WebCam.ConvertBMP(txtConvert.Text,ImageFormat.Gif)
buttonOpenNewFile.Enabled = True
End If
End Sub
Sub ButtonOpenNewFileClick(sender As Object, e As EventArgs)
Process.Start("explorer.exe",WebCam.PathString)
End Sub
Sub ProCamFormClosing(sender As Object, e As FormClosingEventArgs)
WebCam.CloseCam()
End Sub
Sub ProCamFormClosed(sender As Object, e As FormClosedEventArgs)
WebCam.CloseCam()
End Sub
Sub ButtonPlayClick(sender As Object, e As EventArgs)
buttonPlay.Enabled = False
buttonStopVideo.Enabled = True
WebCam.RecordVideo()
End Sub
Sub ButtonStopVideoClick(sender As Object, e As EventArgs)
buttonStopVideo.Enabled = False
buttonPlay.Enabled = True
WebCam.StopVideo(txtVideo.Text)
End Sub
Sub ButtonFileNameVideoClick(sender As Object, e As EventArgs)
If sfdImage.ShowDialog() = DialogResult.OK Then
txtVideo.Text = sfdImage.FileName
sfdImage.FileName = ""
End If
End Sub
Sub ButtonFPSClick(sender As Object, e As EventArgs)
Try
WebCam.setFrameRate(CInt(txtFPS.Text))
iDevice = lstDevices.SelectedItem.ToString()
WebCam.initCam(objPreview.Handle.ToInt32,iDevice)
EnableForm()
Catch
End Try
End Sub
Sub ButtonContactMeClick(sender As Object, e As EventArgs)
Try
System.Diagnostics.Process.Start("mailto: lollo97_ @live.it")
Catch
MessageBox.Show("Nessun server di posta trovato su questo computer." & _
"Contattami su lollo97_@live.it","Errore Mail")
End Try
End Sub
End Class