This is a sample that uses FireMonkey to make your device function as a flashlight.
You can find the FireMonkeyMobile FlashLight project at:
- Start | Programs | Embarcadero RAD Studio XE8 | Samples and then navigate to either:
Object Pascal\Mobile Samples\Device Sensors and Services\FlashLight
CPP\Mobile Samples\Device Sensors and Services\FlashLight
- Subversion Repository for Delphi: http://sourceforge.net/p/radstudiodemos/code/HEAD/tree/branches/RadStudio_XE8/Object%20Pascal/Mobile%20Samples/Device%20Sensors%20and%20Services/FlashLight/
- Subversion Repository for C++: http://sourceforge.net/p/radstudiodemos/code/HEAD/tree/branches/RadStudio_XE8/CPP/Mobile%20Samples/Device%20Sensors%20and%20Services/FlashLight/
This application shows the use of the TCameraComponent to toggle a device flash.
Note: This application only has effect on an actual mobile device.
How to Use the Sample
- Navigate to the one of the locations given above, and open:
- Delphi: FlashLight.dproj
- C++: FlashLight.cbproj
- Press F9 or choose Run > Run.
The project has one source file, FlashLightU.pas, which contains the main form class.
TFlashLightForm represents the main form of the application. It contains the following components:
- The main form contains two TImage objects: ImageOff and ImageOn that are shown or hidden depending on whether the flash is active.
- The flashlight and the light on the screen are also two TImage objects on which two effects are applied: TGlowEffect and TShadowEffect.