May 16, 2018 Replies: 1 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: Code: Copy Dim tRect As B4XRect tRect.Initialize(1dip, 1dip, MyWidth, MyHeight) Dim xPath As B4XPath xPath.InitializeRoundedRect(tRect, 10dip) tCanvas.DrawPath(xPath, Colors.DarkGray, False, 5) XUI v1.60: https://www.b4x.com/android/forum/threads/updates-to-internal-libraries.59340/#post-587118 I just have a question to @Erel ; Why to have another object and not only add DrawRoundRect or DrawArc to the B4XCanvas? Click to expand...
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: Code: Copy Dim tRect As B4XRect tRect.Initialize(1dip, 1dip, MyWidth, MyHeight) Dim xPath As B4XPath xPath.InitializeRoundedRect(tRect, 10dip) tCanvas.DrawPath(xPath, Colors.DarkGray, False, 5) XUI v1.60: https://www.b4x.com/android/forum/threads/updates-to-internal-libraries.59340/#post-587118 I just have a question to @Erel ; Why to have another object and not only add DrawRoundRect or DrawArc to the B4XCanvas?
Erel B4X founder Staff member Licensed User Longtime User May 16, 2018 #2 ivan.tellez said: Why to have another object and not only add DrawRoundRect or DrawArc to the B4XCanvas? Click to expand... Path is more powerful. You can make more complex shapes and more importantly you can clip the drawings based on the path.
ivan.tellez said: Why to have another object and not only add DrawRoundRect or DrawArc to the B4XCanvas? Click to expand... Path is more powerful. You can make more complex shapes and more importantly you can clip the drawings based on the path.