Friday, 15 May 2015

java - How to draw a circle with Bitmap pixels? -


In my app I mix 2 bitmaps, a bitmap is on the screen and when I swipe with my finger The matching pixels from other bitmaps the way I have worked now, but when I touch the screen, it only reveals intersections with other bitmaps because pixels are square, and I touch the screen and expose them to a group I am here. How do I group the pixels together to create a circle?

This is my current code:

  @ Override Public Boolean on Touch Event (Motion Event Event) {Super. Totevent (event); If returned (! Surface Prepared); // Check if the touch pointer is the one you want (event.getPointerId (event.getActionIndex ()) == 0} {switch (event.getAction ()) {Case MotionEvent.ACTION_DOWN: // user touched the screen. Case MotionEvent.ACTION_MOVE: // The user pulled his finger ... mix ((int) event.getX (), (int) event.getY ()); } // Here the blending effect update the bitmap and trigger a frame // radra, // if you do not have the animation thread for doing so drawOverlays (); Back true; }      return false; }  

More compositing code:

  // I made a big brush public to make the effect more "visible" BS = 50; Public Ent HBS = BS & gt; & Gt; 1; Int [] Pixels = New Int [BS * BS]; Private Zero Blend (int x, int y) {if (x> = HBS & y> = HBS & amp; amp; amp; x  


No comments:

Post a Comment