Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class DrawOnTop extends View{
- public DrawOnTop(Context context) {
- super(context);
- }
- @Override
- protected void onDraw(Canvas canvas) {
- // TODO Auto-generated method stub
- Paint paint = new Paint();
- paint.setStyle(Paint.Style.FILL);
- paint.setColor(Color.BLACK);
- paint.setTextSize(20);
- canvas.drawText("Test Text", 20, 20, paint);
- paint.setStyle(Paint.Style.STROKE);
- paint.setStrokeWidth(2);
- paint.setColor(Color.RED);
- Path path = new Path();
- path.moveTo(50, 50);
- path.lineTo(100, 0);
- path.lineTo(150, 50);
- path.close();
- path.offset(110, 150);
- canvas.drawPath(path, paint);
- super.onDraw(canvas);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement