changeset 507:dd65f8c8da66 Android_Skia

Add testpath::onDraw() to add a path on a MBView
author Thinker K.F. Li <thinker@branda.to>
date Tue, 01 Dec 2009 22:55:26 +0800
parents 47c6fd9dd83c
children b106fa78a090
files Android/examples/testpath/src/org/madbutterfly/android/examples/testpath/testpath.java
diffstat 1 files changed, 19 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/Android/examples/testpath/src/org/madbutterfly/android/examples/testpath/testpath.java	Tue Dec 01 22:55:26 2009 +0800
+++ b/Android/examples/testpath/src/org/madbutterfly/android/examples/testpath/testpath.java	Tue Dec 01 22:55:26 2009 +0800
@@ -3,8 +3,12 @@
 import android.app.Activity;
 import android.content.Context;
 import android.os.Bundle;
+import android.graphics.Canvas;
 import org.madbutterfly.MBView;
 import org.madbutterfly.redraw_man;
+import org.madbutterfly.coord;
+import org.madbutterfly.shape;
+import org.madbutterfly.paint;
 
 public class testpath extends Activity
 {
@@ -12,6 +16,21 @@
 	public myview(Context ctx) {
 	    super(ctx);
 	}
+
+	protected void onDraw(Canvas canvas) {
+	    redraw_man rdman;
+	    shape path;
+	    coord _coord;
+	    paint pnt;
+
+	    rdman = get_rdman();
+	    path = rdman.shape_path_new("M 100 100 L 150 100 L 150 150 z");
+	    _coord = rdman.get_root();
+	    _coord.add_shape(path);
+	    pnt = rdman.paint_color_new(1, 1, 1, 1);
+	    pnt.stroke(path);
+	    rdman.redraw();
+	}
     }
 
     MBView main_view;