Android Games App---ripped beauty dress game

Source: Internet
Author: User
Tags android games

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.