Android examples for android.graphics:Canvas
copy Pixels on Canvas
import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Rect; public class Main { private static Rect __src = new Rect(); private static Rect __dst = new Rect(); public static void copyPixels(Canvas c, int left, int top, int width, int height, Bitmap copy_image, int copy_left, int copy_top) { synchronized (Main.class) { __src.set(copy_left, copy_top, copy_left + width, copy_top + height); __dst.set(left, top, left + width, top + height); c.drawBitmap(copy_image, __src, __dst, null); }//www. ja va 2s . c o m } }