Using clipRect – explanation

Canvas.clipRect(left, top, right, bottom) reduces the region of the screen that future draw operations can write to. It sets the clipBounds to be the spacial intersection of the current clipping rectangle and the rectangle specified. There are lot of variants of the clipRect method that accept different forms for regions and allow different operations on … Read more

How to draw Arc between two points on the Canvas?

Finally I got the solution from this code: float radius = 20; final RectF oval = new RectF(); oval.set(point1.x – radius, point1.y – radius, point1.x + radius, point1.y+ radius); Path myPath = new Path(); myPath.arcTo(oval, startAngle, -(float) sweepAngle, true); To calculate startAngle, use this code: int startAngle = (int) (180 / Math.PI * Math.atan2(point.y – … Read more

Rect and RectF in Android SDK

Using Rect you define its edges using integers and using RectF they are defined as floats. Looking at them more carefully I have spotted a few differences actually. I will only list what one implementation has more compared to the other one. Rect equals(Object obj) (for some reason it has its own implementation of equals) … Read more

Drawing a filled rectangle with a border in android

Try paint.setStyle(Paint.Style.FILL) and paint.setStyle(Paint.Style.STROKE). Paint paint = new Paint(); Rect r = new Rect(10, 10, 200, 100); @Override public void onDraw(Canvas canvas) { // fill paint.setStyle(Paint.Style.FILL); paint.setColor(Color.MAGENTA); canvas.drawRect(r, paint); // border paint.setStyle(Paint.Style.STROKE); paint.setColor(Color.BLACK); canvas.drawRect(r, paint); }

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)