HIREVIETNAMESE




iPhone Training
     Lesson 3
http://www.hirevietnamese.com           HIREVIETNAMESE

    Contents

               1      Drawing

               2      Touch and input


               4      Example 3


               5      Exercise 3




                                                    2
http://www.hirevietnamese.com                                    HIREVIETNAMESE

    Drawing

     Quartz 2D
        Quartz 2D is a two dimensional graphics drawing engine that
         makes up the bulk of the UIKit Core Graphics Framework.
        It is a C based application programming interface (API) and as
         such is utilized primarily through calls to a range of C functions.
        Quartz 2D drawing typically takes place on a UIView object.




                                                                               3
http://www.hirevietnamese.com   HIREVIETNAMESE

    Drawing

     Drawing a line




                                            4
http://www.hirevietnamese.com   HIREVIETNAMESE

    Drawing

     Drawing a line




                                            5
http://www.hirevietnamese.com   HIREVIETNAMESE

    Drawing

     Drawing paths




                                            6
http://www.hirevietnamese.com   HIREVIETNAMESE

    Drawing

     Drawing paths




                                            7
http://www.hirevietnamese.com   HIREVIETNAMESE

    Drawing

     Drawing Rectangle




                                            8
http://www.hirevietnamese.com   HIREVIETNAMESE

    Drawing

     Drawing Rectangle




                                            9
http://www.hirevietnamese.com       HIREVIETNAMESE

    Drawing

     Filling a path with a color




                                                10
http://www.hirevietnamese.com       HIREVIETNAMESE

    Drawing

     Filling a path with a color




                                                11
http://www.hirevietnamese.com                 HIREVIETNAMESE

    Drawing

     Drawing an image into Graphic Context




                                                          12
http://www.hirevietnamese.com       HIREVIETNAMESE

    Drawing

     Filling a path with a color




                                                13
http://www.hirevietnamese.com                      HIREVIETNAMESE

    Touch and input

     Events
        touchesBegan:withEvent:
        touchesEnded:withEvent:
        touchesMoved:withEvent:
     Get all touches on the screen
        NSSet *allTouches = [event allTouches];




                                                               14
http://www.hirevietnamese.com   HIREVIETNAMESE

    Example 3




                                            15
http://www.hirevietnamese.com   HIREVIETNAMESE

    Exercise 3




                                            16
HIREVIETNAMESE

Lesson 3