Android Code Snippet [B4X] [XUI] Canvas Draw Round Rect, Arcs, Ovals

Discussion in 'Code Snippets' started by ivan.tellez, May 16, 2018.

  1. ivan.tellez

    ivan.tellez Active Member Licensed User

    XUI v1.60 introduces a new method: DrawPath

    With this, now we have more options to draw:
    • Arc
    • Oval
    • RoundRect
    • LineTo

    Just consult the documentation of each method of the B4XPath object, Asuming an initialized B4XCanvas (tCanvas) the relevant code is:

    Dim tRect As B4XRect
    1dip1dip, MyWidth, MyHeight)
    Dim xPath As B4XPath
    Colors.DarkGray, False5)

    XUI v1.60:

    I just have a question to @Erel ; Why to have another object and not only add DrawRoundRect or DrawArc to the B4XCanvas?
  2. Erel

    Erel Administrator Staff Member Licensed User

    Path is more powerful. You can make more complex shapes and more importantly you can clip the drawings based on the path.
    Johan Hormaza likes this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice