This C# application allows the use of external webcams.
The full path for the project file is: WinCameraApp/CameraViewer/CameraViewer/Project/CameraSamples.sln. The full path for the source code is: WinCameraApp/CameraViewer/CameraViewer/Project/CameraControlTool
Through the use of the CNET_Library, settings such as brightness, hue, contrast can be manipulated.
The key classes in working with this are:
- Camera.cs // Camera class
- CameraControl.cs // Access methods for the Camera such as setting resolution, taking a picture, etc.
- FormCameraControlTool.Designer.cs // holds the layout of the main applet
- FormCameraControlTool.cs // holds the core view functions
For example, the process to add the functionality of taking a picture:
- Create a button in FormCameraControlTool.Designer.cs - define its dimensions and features - add it to the tablelayoutpanel
- Create function: private void buttonSavePicture_Click(object sender, EventArgs e){} in FormCameraControlTool.cs
- Map the button to the function
- this.buttonSavePicture.Click += new System.EventHandler(this.buttonSavePicture_Click);
The key classes for adding features are in CameraControlTool->Inspection Classes and CameraControlTool->Inspection Forms. Currently custom parts can be added. This is done using the EnginePartListForm and Part.cs and PartList.cs. To expand this to have Sections and Engines follow the structure in EnginePartListForm.
- Create a form such as SectionPartListForm, following the template of EnginePartListForm.
- Replace the PartList with SectionList
- In the add/remove methods, replace Part with Section.
- The same can be done with EnginesList and Engine
Then adding the features can easily be done using the built in designer in Visual Studio. In the designer:
- Double Click File->Manage Engines and it will direct you to the corresponding function call.
- Create the new form you created and show it