# HG changeset patch # User Thinker K.F. Li # Date 1259679326 -28800 # Node ID dd65f8c8da66dd745b25b39e09ad2894c48a963f # Parent 47c6fd9dd83c44d047f50582b1714ee5149e8c9e Add testpath::onDraw() to add a path on a MBView diff -r 47c6fd9dd83c -r dd65f8c8da66 Android/examples/testpath/src/org/madbutterfly/android/examples/testpath/testpath.java --- 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;