I can get the central point of the circular, so I want to draw some buttons around the central point of the circular See, you can give me some advice, links will be more useful for examples. This is my code
Edit:
Public class extends drawCirPicture activity Is called {/ ** when activity has been created previously * / @Override Public Shun OnCreate (bundled savedInstanceState) {super.onCreate (savedInstanceState); SetContentView (new sample view (this)); } View private static class sample view {Private bitmap mbitmap; Public Sample View (Reference Reference) {Super (Reference); SetFocusable (true); InputStream = Reference is GetResources () OpenRawResource (android.R.drawable.sym_call_outgoing); MBitmap = Bitmapficht. Decodestream (is); } @ Override Scared Protected Zero (Canvas Canvas) {Canvas Left Color (Color. GRA); Paint P = new paint (); Float center Y = 200; Float center X = 130; Double alpha = 0, wedge = 0; Double PI = Math PI; Float x, y; Int radius = 55; (Alpha = 0, wedge = 2 * pi / 4; alpha and lt; 2 * pi; alpha + = wedge) {x = (float) (center x + radius * math (alpha)); Y = (float) (center Y + radius * Math.sin (alpha)); Canvas.drawBitmap (mbitmap, x, y, p); }} @ Override Public Boolean On Touch Event (// Todo Auto-Generated Method Stub Return Super. Totevent (event); } @ Perform override public boolean click () {// Two-auto-generated method stub returns super. PerformClick (); }}} I can put images in the circular path, but I was not able to implement the Achchauch event or the Okwell event of each image, and even centerX or centerY The edge detects how to place images in the wide area of the screen.
x = centerx + radius * cos (alpha) y = centerY + radius * sin ( Alpha) where alpha is between 0 and 2 * PI . Trigonometry is cool.
Comments
Post a Comment