Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android alternative for Line2D?

I'm trying to translate some Java-speak into Android-Java-speak, and have a bit of code involving Point2Ds and Line2Ds. I know Point2D.Float's equivalent is PointF, but is there anything similar to Line2D or am I going to have to restructure and rewrite this entirely? If so... help?

like image 254
Kalina Avatar asked Jun 20 '11 17:06

Kalina


1 Answers

You can use Path for example:

Paint paint = new Paint();
paint.setStyle(Paint.Style.STROKE);
paint.setStrokeWidth(5);

paint.setColor(Color.WHITE);
Path line2d = new Path();
// just example for line could be complex shape
line2d.moveTo(pointF1.x, pointF1.y);
line2d.lineTo(pointF2.x, pointF2.y);
like image 86
terma Avatar answered Oct 10 '22 12:10

terma