Click here to Skip to main content
15,885,914 members
Articles / Desktop Programming / Windows Forms

Versatile WebCam C# library

Rate me:
Please Sign up or sign in to vote.
4.96/5 (137 votes)
23 Feb 2015CPOL9 min read 1.1M   85K   444  
Easy to use C# WebCam library that's not plagued with weird DLL references or PInvoke calls
<UserControl x:Class="Touchless.Vision.Camera.Configuration.CameraFrameSourceConfigurationElement"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
     Width="550" Height="260">
    <GroupBox Header="Camera Settings">
        <StackPanel Orientation="Horizontal">
            <StackPanel Orientation="Vertical" Width="200">
                <ComboBox x:Name="comboBoxCameras" SelectionChanged="comboBoxCameras_SelectionChanged" />
                <StackPanel x:Name="panelCameraInfo" Orientation="Vertical" MinWidth="180" DataContext="{Binding SelectedItem, ElementName=comboBoxCameras, Mode=Default}">
                    <Button Click="buttonCameraProperties_Click" x:Name="buttonCameraProperties" Content="Adjust Camera Properties" Margin="0,10,0,10" />
                    <CheckBox Content="Flip Image Horizontally" IsChecked="{Binding FlipHorizontal, Mode=TwoWay}" />
                    <CheckBox Content="Flip Image Vertically" IsChecked="{Binding FlipVertical, Mode=TwoWay}" />
                    <StackPanel Orientation="Horizontal" Margin="0,10,0,10">
                        <Label VerticalAlignment="Center" Margin="-1">Current Frames Per Second:</Label>
                        <Label x:Name="labelCameraFPSValue" Content="{Binding Fps, Mode=Default}" Margin="3,0,0,0" Width="40" HorizontalContentAlignment="Right"></Label>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <CheckBox x:Name="chkLimitFps" Content="Limit Frames Per Second:" VerticalAlignment="Center" Checked="chkLimitFps_Checked" Unchecked="chkLimitFps_Unchecked" />
                        <TextBox x:Name="txtLimitFps" Margin="10,0,0,0" Text="-1" Width="40" VerticalAlignment="Center" MaxLines="1" HorizontalContentAlignment="Right" IsEnabled="False" TextChanged="txtLimitFps_TextChanged" />
                    </StackPanel>
                </StackPanel>
            </StackPanel>
            <Image x:Name="imgPreview" Width="320" Height="240" Margin="10,0,10,0" Stretch="Fill" VerticalAlignment="Top" />
        </StackPanel>
    </GroupBox>
</UserControl>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Chief Technology Officer
United States United States
If you liked this article, consider reading other articles by me. For republishing article on other websites, please contact me by leaving a comment.

Comments and Discussions