search

Home  >  Q&A  >  body text

java - canvas的问题,如何画出组合图形

用canvers.draw方法是可以画出竖线但是如何把上面的圆形画出?如图中游标

伊谢尔伦伊谢尔伦2804 days ago526

reply all(2)I'll reply

  • PHP中文网

    PHP中文网2017-04-18 10:58:35

    Now that you can draw a line, you can then use canvas.drawCircle to draw a circle, which will let you pass in several parameters, such as center coordinates, radius, etc., and then you only need to calculate it based on the position of the line. Just find out the coordinates of your circle center and the appropriate radius, and you’re good to go

    reply
    0
  • 阿神

    阿神2017-04-18 10:58:35

    Can be used

    canvas.drawCircle(500,500,400,mPaint);
    

    There are four parameters for drawing a circle, the first two are the coordinates of the center of the circle, the third is the radius, and the last one is the brush.

    reply
    0
  • Cancelreply