Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. Clever Code
  4. Simple Camera Tethering Using WIA

Simple Camera Tethering Using WIA

Scheduled Pinned Locked Moved Clever Code
careercsharpdotnetdebugging
3 Posts 3 Posters 20 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    gmillwater
    wrote on last edited by
    #1

    I'm a freelance studio/event photographer. For years I've had to use often expensive and complex software to tether my cameras to my laptop. I needed a fast, lightweight tool to do the job without all the cumbersome tools, so as the saying goes "if you want it done right, do it yourself". Here is a quick and simple framework for tethering Nikon cameras with near instant file transfer and image viewing. This is just a vb.net framework and should be modified to suit your taste. Have fun... Imports WIA Imports System.Runtime.InteropServices Imports System.Environment Imports System.IO 'Add reference to wiaaut.dll located in \Windows\System32 'Add Panel1 with Dock=Fill and BackgroundImage=Zoom 'Form1.text = Waiting... Public Class Form1 Public Const wiaEventItemCreated = "{4C8F4EF5-E14F-11D2-B326-00C04F68CE61}" Public Const wiaEventDeviceConnected = "{A28BBADE-64B6-11D2-A231-00C04FA31809}" Public Const wiaEventDeviceDisconnected = "{143E4E83-6497-11D2-A231-00C04FA31809}" Public WIA_Dialog As New WIA.CommonDialog Public WIA_DeviceMgr As New WIA.DeviceManager Public WIA_Device As WIA.Device Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load WIA_DeviceMgr.RegisterEvent(wiaEventItemCreated, "*") WIA_DeviceMgr.RegisterEvent(wiaEventDeviceConnected, "*") WIA_DeviceMgr.RegisterEvent(wiaEventDeviceDisconnected, "*") AddHandler WIA_DeviceMgr.OnEvent, AddressOf Me.WIA_OnEvent End Sub Private Sub WIA_OnEvent(ByVal EventID As String, ByVal DeviceID As String, ByVal ItemId As String) Dim device As String If EventID = wiaEventDeviceConnected Then Try 'set param2 to False to automatically select the device 'set param2 to True to show device select dialog WIA_Device = WIA_Dialog.ShowSelectDevice(WiaDeviceType.CameraDeviceType, False, True) 'display device information device = "Connected To " For Each prop As WIA.Property In WIA_Device.Properties Select Case prop.Name Case "Manufacturer" device += prop.Value.ToString & " " Case "Description" device += prop.Value.ToString End Select Next Me.Text = device Catch ex As Exception Debug.WriteLine("E

    P D 2 Replies Last reply
    0
    • G gmillwater

      I'm a freelance studio/event photographer. For years I've had to use often expensive and complex software to tether my cameras to my laptop. I needed a fast, lightweight tool to do the job without all the cumbersome tools, so as the saying goes "if you want it done right, do it yourself". Here is a quick and simple framework for tethering Nikon cameras with near instant file transfer and image viewing. This is just a vb.net framework and should be modified to suit your taste. Have fun... Imports WIA Imports System.Runtime.InteropServices Imports System.Environment Imports System.IO 'Add reference to wiaaut.dll located in \Windows\System32 'Add Panel1 with Dock=Fill and BackgroundImage=Zoom 'Form1.text = Waiting... Public Class Form1 Public Const wiaEventItemCreated = "{4C8F4EF5-E14F-11D2-B326-00C04F68CE61}" Public Const wiaEventDeviceConnected = "{A28BBADE-64B6-11D2-A231-00C04FA31809}" Public Const wiaEventDeviceDisconnected = "{143E4E83-6497-11D2-A231-00C04FA31809}" Public WIA_Dialog As New WIA.CommonDialog Public WIA_DeviceMgr As New WIA.DeviceManager Public WIA_Device As WIA.Device Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load WIA_DeviceMgr.RegisterEvent(wiaEventItemCreated, "*") WIA_DeviceMgr.RegisterEvent(wiaEventDeviceConnected, "*") WIA_DeviceMgr.RegisterEvent(wiaEventDeviceDisconnected, "*") AddHandler WIA_DeviceMgr.OnEvent, AddressOf Me.WIA_OnEvent End Sub Private Sub WIA_OnEvent(ByVal EventID As String, ByVal DeviceID As String, ByVal ItemId As String) Dim device As String If EventID = wiaEventDeviceConnected Then Try 'set param2 to False to automatically select the device 'set param2 to True to show device select dialog WIA_Device = WIA_Dialog.ShowSelectDevice(WiaDeviceType.CameraDeviceType, False, True) 'display device information device = "Connected To " For Each prop As WIA.Property In WIA_Device.Properties Select Case prop.Name Case "Manufacturer" device += prop.Value.ToString & " " Case "Description" device += prop.Value.ToString End Select Next Me.Text = device Catch ex As Exception Debug.WriteLine("E

      P Offline
      P Offline
      PIEBALDconsult
      wrote on last edited by
      #2

      Perhaps you should make this a tip?

      1 Reply Last reply
      0
      • G gmillwater

        I'm a freelance studio/event photographer. For years I've had to use often expensive and complex software to tether my cameras to my laptop. I needed a fast, lightweight tool to do the job without all the cumbersome tools, so as the saying goes "if you want it done right, do it yourself". Here is a quick and simple framework for tethering Nikon cameras with near instant file transfer and image viewing. This is just a vb.net framework and should be modified to suit your taste. Have fun... Imports WIA Imports System.Runtime.InteropServices Imports System.Environment Imports System.IO 'Add reference to wiaaut.dll located in \Windows\System32 'Add Panel1 with Dock=Fill and BackgroundImage=Zoom 'Form1.text = Waiting... Public Class Form1 Public Const wiaEventItemCreated = "{4C8F4EF5-E14F-11D2-B326-00C04F68CE61}" Public Const wiaEventDeviceConnected = "{A28BBADE-64B6-11D2-A231-00C04FA31809}" Public Const wiaEventDeviceDisconnected = "{143E4E83-6497-11D2-A231-00C04FA31809}" Public WIA_Dialog As New WIA.CommonDialog Public WIA_DeviceMgr As New WIA.DeviceManager Public WIA_Device As WIA.Device Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load WIA_DeviceMgr.RegisterEvent(wiaEventItemCreated, "*") WIA_DeviceMgr.RegisterEvent(wiaEventDeviceConnected, "*") WIA_DeviceMgr.RegisterEvent(wiaEventDeviceDisconnected, "*") AddHandler WIA_DeviceMgr.OnEvent, AddressOf Me.WIA_OnEvent End Sub Private Sub WIA_OnEvent(ByVal EventID As String, ByVal DeviceID As String, ByVal ItemId As String) Dim device As String If EventID = wiaEventDeviceConnected Then Try 'set param2 to False to automatically select the device 'set param2 to True to show device select dialog WIA_Device = WIA_Dialog.ShowSelectDevice(WiaDeviceType.CameraDeviceType, False, True) 'display device information device = "Connected To " For Each prop As WIA.Property In WIA_Device.Properties Select Case prop.Name Case "Manufacturer" device += prop.Value.ToString & " " Case "Description" device += prop.Value.ToString End Select Next Me.Text = device Catch ex As Exception Debug.WriteLine("E

        D Offline
        D Offline
        DaveAuld
        wrote on last edited by
        #3

        Can you edit and wrap the code in a pre block with the correct lang attribute value.

        Dave Find Me On: Web|Facebook|Twitter|LinkedIn


        Folding Stats: Team CodeProject

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups