Introduction to Canvas

11
ANDROID: CANVAS THE BASICS CodeAndroid.org

description

by Tan Teck Loon

Transcript of Introduction to Canvas

Page 1: Introduction to Canvas

ANDROID: CANVAS THE BASICS

CodeAndroid.org

Page 2: Introduction to Canvas

Why Canvas? For Multimedia Applications

Games, full visual applications

Control over the Visual Effects

Allows animation to be done freely

Unique Response according to author’s design

Page 3: Introduction to Canvas

No longer Needed

Page 4: Introduction to Canvas

Fundamentals

Page 5: Introduction to Canvas

Drawing an image(basic) Specify the coordinate and paint

Coordinate X and Y and paint

Paint functions

Color

Alpha(transparent)

http://developer.android.com/reference/android/graphics/Paint.html

Canvas itself

Color(background)

Page 6: Introduction to Canvas

Drawing shape and text

Page 7: Introduction to Canvas

Adding Bitmap

Page 8: Introduction to Canvas

Text Size and alpha

Page 9: Introduction to Canvas

Response onKeyDown(int, KeyEvent)

onKeyUp(int, KeyEvent)

onTrackballEvent(int, KeyEvent)

onTouchEvent(int, KeyEvent)

Page 10: Introduction to Canvas

Question and Sharing

Page 11: Introduction to Canvas

Thank you