Everything you need is in PathEffects.java of API Demos. mPaint.setPathEffect( new DashPathEffect(new float[] { 15, 5, 8, 5 }, phase) );
On Jul 18, 3:00 pm, karthikr <karthik.scintill...@gmail.com> wrote: > I had a look at the demos but i am not able to find out as to how to > draw a dotted rectangle. > > Can someone help me out with some example? > > On Jul 17, 8:57 pm, Peli <peli0...@googlemail.com> wrote: > > > > > Have you looked into the API demos? There are a couple of examples of > > lines with various patterns. > > > Peliwww.openintents.org > > > On Jul 17, 5:49 pm, karthikr <karthik.scintill...@gmail.com> wrote: > > > > Hi Guys, > > > > How do i draw a dotted rectangle on a bitmape. > > > > Currently i use the following code, to draw a rectangle, but i want > > > the line to be a dotted one. > > > > Can someone help me out... > > > > Paint mPaint = new Paint(); > > > mPath.addRect(left, top, right, bottom, Direction.CCW); > > > mPaint.setAntiAlias(true); > > > mPaint.setDither(true); > > > mPaint.setColor(Color.GRAY); > > > mPaint.setStrokeWidth(1); > > > mCanvas.drawPath(mPath, mPaint); > > > > Regards, > > > R.Karthik- Hide quoted text - > > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---