Created
April 27, 2011 05:33
-
-
Save agiletalk/943765 to your computer and use it in GitHub Desktop.
[예제] Canvas draw- 메서드 more
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void onDraw(Canvas canvas) { | |
Paint Pnt = new Paint(); | |
//canvas.drawARGB(255, 255, 255, 255); | |
//canvas.drawRGB(255, 255, 255); | |
//canvas.drawColor(0xffffffff); | |
Pnt.setColor(Color.WHITE); | |
canvas.drawPaint(Pnt); | |
RectF r = new RectF(10,10,100,100); | |
Pnt.setColor(Color.YELLOW); | |
canvas.drawRoundRect(r,10,10,Pnt); | |
r.set(110, 10, 150, 100); | |
canvas.drawOval(r, Pnt); | |
Pnt.setColor(Color.GREEN); | |
r.set(10,110,100,200); | |
canvas.drawArc(r, 10, 150, false, Pnt); | |
r.set(110,110,200,200); | |
canvas.drawArc(r, 10, 150, true, Pnt); | |
Pnt.setColor(Color.BLUE); | |
float[] pts = {10, 210, 50, 250, 50, 250, 110, 220}; | |
canvas.drawLines(pts, Pnt); | |
Pnt.setColor(Color.WHITE); | |
float[] pts2 = {20, 210, 50, 240, 100, 220}; | |
canvas.drawPoints(pts2, Pnt); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment