How to Use the Microsoft Visual Studio C Compiler for Picture Programming
Picture programming is the art and science of capturing photographs as digital images on the personal computer and further enhancing and processing the images. You can write picture programming applications in Visual C++ using Microsoft's Picture Acquisition software development kit (SDK) along with Microsoft Foundation Classes (MFC). An application programming interface (API) manages the process of acquiring photos from a device such as a digital camera. The API is a set of classes and methods, or a set of functions, that filter images, transfer images from the device, and offer dialog boxes for device selection, options and parameters.
Instructions
-
-
1
Create a basic C++ MFC framework application in Visual Studio.
-
2
Add a dialog to your basic MFC framework to enable the user to select a device from which he/she will acquire the images. Add the dialog by making a call to the picture acquisition SDK API function "IPhotoAcquireDeviceSelectionDialog." With this your image acquisition session begins.
-
-
3
Add a dialog box to allow the user to make parameter settings such as file name formats, image rotation, erasing photos after importing and prompting for tags. Call the "IPhotoAcquireOptionsDialog" interface from the picture acquisition API. Use the "IPhotoAcquireSettings" interface to make acquisition settings programatically. Call IPhotoAcquireSettings::SetOutputFilenameTemplate () by specifying a format template string to set the file name format.
-
4
Call the "CreatePhotoSource" method of the "IPhotoAcquire" interface to initialize an instance of "IPhotoAcquireSource" object that represents the image source. Make the call at the point that the user or program selects the camera device. Call other methods of the "IPhotoAcquireSource" interface to manage the list of items of acquisition and manage settings and device-specific properties.
-
5
Call IPhotoAcquire::Acquire() method to acquire items from the device of selected type. Use the IPhotoAcquireItem interface to work with individual items before or during transfer.
-
6
Use the "IPhotoAcquireProgressCB" interface to override default behavior provided by the SDK and supply additional functionality specific to your application, in response to events such as end of item transfer or start of item deletion.
-
7
Pass reference to the object that implemented IPhotoAcquireProgressCB (your picture acquisition source object) to IPhotoAcquire::Acquire () to handle events during picture acquisition. Pass the same object reference to IPhotoAcquireSource::InitializeItemList () to handle events during photo enumeration. Call IPhotoProgressDialog () if you want to show a progress bar during the acquisition or enumeration process.
-
1
Tips & Warnings
Create a picture acquisition plug-in to be used by other interfaces using the picture acquisition SDK, as an extension to Windows Vista's built-in functionality for acquiring photos from a device. To create a custom plug-in, implement dynamic link library (DLL) functions, and the IClassFactory and IPhotoAcquirePlugin interfaces.
References
- Photo Credit digital camera image by Mitarart from Fotolia.com