ImageView After;imageview before; @Overrideprotected void OnCreate (Bundle savedinstancestate) {super.oncreate ( Savedinstancestate); Setcontentview (r.layout.activity_main); after = (ImageView) Findviewbyid (r.id.after); Before= ( ImageView) Findviewbyid (r.id.before); Options options = new options ();//options.insamplesize = 2; Bitmap Aftermap = Bitmapfactory.decoderesource (Getresources (), r.drawable.g7_back,options); Bitmap Beforemap = Bitmapfactory.decoderesource (Getresources (), r.drawable.g7_up,options);//Can change bitmapfinal Bitmap Altermap = Bitmap.createbitmap (+, Beforemap.getconfig ());//create canvas final canvas canvas = new canvas (ALTERMAP);// Create Brush Final paint paint = new paint ();p aint.setcolor (color.black);p aint.setstrokewidth (5); Canvas.drawbitmap (Beforemap , New Matrix (), paint); After.setimagebitmap (Aftermap); Before.setimagebitmap (Beforemap); Before.setontouchlistener ( New Ontouchlistener () {@Overridepublic Boolean onTouch (View V, motionevent event) {switch (event.getaction ()) {case Motio Nevent.actIon_down:break;case MotionEvent.ACTION_MOVE:int newx = (int) event.getx (); int newy = (int) event.gety (); for (int i=-8;i& lt;8;i++) {for (int j=-8;j<8;j++) Altermap.setpixel (i+newx, J+newy, color.transparent);} Before.setimagebitmap (Altermap); break;case Motionevent.action_up:break;default:break;} return true;});}
Android Games App---ripped beauty dress game