Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 97 - 2615_KEC
P. 97

    Image Manipulation  Blocks: These blocks allow you  to  manipulate  images  on the
                       Canvas.

                       o  Call Canvas.Save: Saves the current contents of the Canvas as an image file.

                       o  Call Canvas.SaveAs (fileName): Saves the current contents of the Canvas as an
                          image file with a specified name.

                       o  Call  Canvas.GetBackgroundPixelColor  (x, y): Gets  the  color of the  pixel  at  the
                          specified coordinates.
                       o  Call Canvas.GetPixelColor (x, y): Gets  the  color  of the  pixel  at  the  specified

                          coordinates.

                       o  Call Canvas.SetBackgroundPixelColor (x, y, color): Sets the color of the pixel at the
                          specified coordinates.

                     CANVAS RESPONSIVENESS WITH UI COMPONENTS

                     When designing an app using MIT App Inventor, ensuring that the Canvas component is
                     responsive allows it to adapt well to different screen sizes, orientations and UI elements
                     such as buttons, sliders, labels and arrangements.

                     A responsive Canvas is essential for games, drawing apps and interactive applications
                     where users interact with objects on the screen.

                     Now, perform the following steps to design a Magic Touch Ball app:

                     Step  1   Create new project in the MIT App Inventor.

                     Step  2   Change the name of the screen to Magic Touch Ball in the Title textbox in the
                               Properties pane.

                                                                                             UI Design and Touch Events  95

| 92 93 94 95 96 97 98 99 100 101 102 |