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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

TextNode SizeToText

Thread ID:

Created:

Updated:

Platform:

Replies:

35869 Oct 12,2005 12:53 PM UTC Oct 13,2005 05:21 PM UTC Windows Forms 2
loading
Tags: Diagram
Administrator [Syncfusion]
Asked On October 12, 2005 12:53 PM UTC

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

Administrator [Syncfusion]
Replied On 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.,

Administrator [Syncfusion]
Replied On 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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;