import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
public class MeterInAndroid {
private int height;
private int width;
int y=0;
private int radius=100;
public MeterInAndroid(Context context,int h,int w)
{
height=h;
width=w;
}
public void Draw(Canvas canvas)
{
Paint p=new Paint();
p.setColor(Color.WHITE);
double Number = Math.PI * 2 / 10;
double Number2=Number*y;
y++;
float endX = (float) (width/2+(radius*(Math.cos(Number2))));
float endY = (float) (height/2+(radius*(Math.sin(Number2))));
canvas.drawLine(width/2, height/2, endX, endY, p);
}
}
No comments:
Post a Comment