Y ykucuk Well-Known Member Licensed User Longtime User Oct 16, 2017 #1 Hi Canvas.MeasureStringWidth doesn't work when text is long or include CRLF Any help?
Erel B4X founder Staff member Licensed User Longtime User Oct 17, 2017 #2 What are you using it for? Upvote 0
Y ykucuk Well-Known Member Licensed User Longtime User Oct 17, 2017 #3 I am trying to create chat bubble. I need to change the width of bubble according to text length. Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Oct 17, 2017 #4 Assuming that Label.SingleLine is False then the text will be wrapped if it is too long. Canvas.MeasureStringWidth will return the string length without the text being wrapped. StringUtils.MeasureMultilineTextHeight will return the correct height with the wrapped text. Upvote 0
Assuming that Label.SingleLine is False then the text will be wrapped if it is too long. Canvas.MeasureStringWidth will return the string length without the text being wrapped. StringUtils.MeasureMultilineTextHeight will return the correct height with the wrapped text.
Y ykucuk Well-Known Member Licensed User Longtime User Oct 17, 2017 #5 StringUtils.MeasureMultilineTextHeight is work fine. What I want to to do: message "ok" and "how are you" should be the different width. I need calc this width. Upvote 0
StringUtils.MeasureMultilineTextHeight is work fine. What I want to to do: message "ok" and "how are you" should be the different width. I need calc this width.
Erel B4X founder Staff member Licensed User Longtime User Oct 18, 2017 #6 Canvas.MeasureStringWidth should work with these strings. Upvote 0