Introduction to Canvas

Post on 17-Jan-2015

7.335 views 2 download

description

by Tan Teck Loon

Transcript of Introduction to Canvas

ANDROID: CANVAS THE BASICS

CodeAndroid.org

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

No longer Needed

Fundamentals

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)

Drawing shape and text

Adding Bitmap

Text Size and alpha

Response onKeyDown(int, KeyEvent)

onKeyUp(int, KeyEvent)

onTrackballEvent(int, KeyEvent)

onTouchEvent(int, KeyEvent)

Question and Sharing

Thank you