locked
Programmatically changing Microsoft LifeCam Camera Settings in .Net RRS feed

  • Question

  • Hi,

    The Microsoft LifeCam software lets you switch off automatic settings (like AutoFocus, White Balance, Exposure, ...) but after a reboot the software seems to have forgotten these settings. I would like to change these settings by writing a custom .Net program. Therefore I looked at the LifeCam dlls, and I find a class "CameraSettings", but I don't find how to set these to the default camera.

    Where can I ask a question about the LifeCam API, and more specifically how to change these auto-settings?

    Jim


    Jim
    Sunday, March 20, 2011 11:13 AM

Answers

  • I think these settings are stored application wide. E.g. if you were writing a webcam-aware software you should save the webcam settings in your software's settings and restore the setting after you launch your app again. 

    If you want to know how to get/set these settings, I suggest you to visit the DirectShow development forum.



    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    Tuesday, March 29, 2011 5:20 AM

All replies

  • I think these settings are stored application wide. E.g. if you were writing a webcam-aware software you should save the webcam settings in your software's settings and restore the setting after you launch your app again. 

    If you want to know how to get/set these settings, I suggest you to visit the DirectShow development forum.



    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    Tuesday, March 29, 2011 5:20 AM
  • I built a little command line utility for setting LifeCam settings. It reads in settings via XML—admittedly not the most elegant solution, but it worked great for our needs. Hopefully it will help you, too.

    To download and use it:

    1. Download the latest version from http://dev.marcelray.com/downloads/CameraPrefs.zip
    2. Extract the ZIP to a permanent location, such as C:\Program Files\CameraPrefs
    3. Create a shortcut to CameraPrefs.exe in your Start Menu's Startup folder.
    4. Open CameraPrefs.xml in Wordpad or another text editor (Notepad has difficulties with the line endings).
    5. Open the Microsoft LifeCam tool from your Start Menu.
    6. Click the little white right arrow/triangle along the right border of the application to expand the settings panel.
    7. Click the gear icon at the top.
    8. Note the name listed in the Select Webcam drop down (e.g. "Microsoft LifeCam Cinema")
    9. Scroll down and click the Properties… button under Image Adjustments.
    10. Adjust the camera settings to your preference.
    11. Go back to the CameraPrefs.xml document.
    12. Set the name attribute in the <camera> tag to the name noted in step 7.
    13. Modify the rest of the properties in the XML to match the values you set in the Properties dialog in the LifeCam tool.

    A couple notes:

    • Requires the .NET 3.5 runtime. If you're running Windows Vista or Windows 7, you should be fine.
    • Higher zoom levels don't seem to take effect. For the LifeCam Studio, it seems to ignore values above 60.
    • Setting auto exposure doesn't seem to work, either. To enable (or disable) this feature, set the trueColorEnabled tag's value to true (on) or false (off).

    If you’d like to play with the source, you can download it here: http://dev.marcelray.com/downloads/CameraPrefs_Source.zip 

    Feel free to modify or redistribute as you see fit. Note that I’m not a C# or .NET developer by trade, so please bear with any wonkiness in the code!

    Monday, June 18, 2012 8:54 PM