enumerateCameras():
This function populates the <select> box with all available cameras found on the device.
initCaptureSettings()
The initCaptureSettings() function creates an object of type MediaCaptureInitializationSettings and sets some of the properties. This is built into WinRT, and it makes it very easy to specify various properties. Here we set the streaming capture mode to audio and video and also set the photo capture source to video preview.
releaseMediaCapture()
This function releases the mediaCaptureMgr object and calls for garbage collection.
startDevice()
The startDevice() function creates the MediaCapture object and binds an error handler to it. Afterwards, the async initialization function is called to start the device.
startPreview()
This function sets all of the effects’ default original values, sets the amount each effect increases per button click, and also enables all of the effect buttons for use.
clearEffect()
Resets all effect values to 0.
increaseBrightness()
Event handler called when the increase brightness button is pressed. Increases the effect value by the step value.
decreaseBrightness()
Event handler called when the decrease brightness button is pressed. Decreases the effect value by the step value.
increaseContrast()
Event handler called when the increase contrast button is pressed. Increases the effect value by the step value.
decreaseContrast()
Event handler called when the decrease contrast button is pressed. Decreases the effect value by the step value.
increaseHue()
Event handler called when the increase hue button is pressed. Increases the effect value by the step value.
decreaseHue()
Event handler called when the decrease hue button is pressed. Decreases the effect value by the step value.
increaseFocus()
Event handler called when the increase focus button is pressed. Increases the effect value by the step value.
decreaseFocus()
Event handler called when the decrease focus button is pressed. Decreases the effect value by the step value.
increaseExposure()
Event handler called when the increase exposure button is pressed. Increases the effect value by the step value.
decreaseExposure()
Event handler called when the decrease exposure button is pressed. Decreases the effect value by the step value.
increaseZoom()
Event handler called when the increase zoom button is pressed. Increases the effect value by the step value.
decreaseZoom()
Event handler called when the decrease zoom button is pressed. Decreases the effect value by the step value.
increaseWhiteBal()
Event handler called when the increase white balance button is pressed. Increases the effect value by the step value.
decreaseWhiteBal()
Event handler called when the decrease white balance button is pressed. Decreases the effect value by the step value.
capturePhoto()
This is where we actually take the photo. The function first gets the picture library folder location to put the returned file, and then the function creates the actual file itself. After the file is created, the photo is captured and then saved to that photo. The photo is then sent to the pictures library.
showMessage(message)This method just makes it easy to display the status of the application to the user.
displayTimeDifference()
This function sets the status to show how long it took to take the photo.
onCameraChange()
This function disables all of the buttons, and calls initCaptureSettings() again. The state before the user hits preview is restored.
initialize()
This function disables every button and calls enumerateCameras(). Every event handler is tied to its corresponding button, and then all of the effect values are set to 0. The user is now ready to start using the application.
The application starts out by searching for all cameras on the device and then displays them all in a drop-down menu. The user can select whichever camera they want to use and then click “Start Device." If the device was successful in starting up, the preview button enables itself. When the user clicks preview, a video stream will start on the left image box, and all of the property adjustment buttons will be enabled. When the user clicks any of the property adjustment buttons, the preview will change in real time. When the user is satisfied that all the property levels are correct, the user can capture a photo by tapping on the right image box. The photo will be saved to that image box, and a copy will also be saved in the Pictures Library. The time it took to capture the photo displays underneath the right image box after a photo is taken.
Here was the Sample Source Code:
https://www.mediafire.com/?qw2wx1g948oovox