We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

TextNode SizeToText

Hello, What is the proper usage for the method: Textnode.SizeToText(SizeF layoutArea) I am current using it as: textNode.SizeToText(new SizeF(1000f, 1000f)); My text nodes are generated using strings from a database, so the text node''s size is not pre-determined. During performance analysis, I have noticed that this method takes up a significant chunk of processing (10%) so if you have any other ideas for determining text node size, please let me know. Thanks, Kevin

2 Replies

AD Administrator Syncfusion Team October 13, 2005 04:01 PM UTC

Hi Kevin, If you can, use the Symbol bounds for the layoutarea param when calling the TextNode.SizeToText(...) method. SizeToText(..) internally uses Graphics.MeasureString(String, Font, SizeF, StringFormat) to estimate the text bounds, and passes in the layoutarea as the maximum hint size. The performance draw within the SizeToText is probably due to the TextNode class attempting to calculate the text than can be accomodated on each line. Thanks, Prakash Surendra Syncfusion Inc.,


AD Administrator Syncfusion Team October 13, 2005 05:21 PM UTC

Prakash, Thanks for the reply. There are actually no defined bounds for the symbol. If the text is 500 characters long then the TextNode will have to be made wide enough to accomodate the text, which in turn changes the bounds of its parent, the symbol. This is not a problem by any means, and it looks like I have no choice but to use it for determining TextNode size. Thanks for the information, Kevin

Loader.
Live Chat Icon For mobile
Up arrow icon