Page 94 - KEC Khaitan C5 Flipbook
P. 94
o Position color buttons below the canvas.
o Include a large "Clear" button for easy access.
Sample Layout
3. Coding the App
Brush Color Customization:
o Program buttons to change the brush color when clicked.
o Example: Red button applies red brush, green button applies green brush, etc.
Clear Canvas Feature:
o Code a "Clear" button to erase all drawings on the canvas.
Shake to Clear (Accelerometer Integration):
o Use the accelerometer component to detect when the device is shaken.
o Program the app to clear the canvas when shaking is detected.
Sample Code Blocks:
o When Red Button Clicked Set Canvas PaintColor to Red.
o When Accelerometer Shaking Call Canvas.Clear.
Sample Code
92 Premium Edition-V

