取消
显示结果 
搜索替代 
您的意思是: 

calculating text string size

I want to fit the size of a string indicator to the string itself.
In attachment (LV 8.2), the size(width and height) of each string line was calculated by using Get Text Rect.
Unfortunately, the size might be over(or under)-estimated comparing to the real size.
How to resolve this problem?
0 项奖励
1 条消息(共 5 条)
3,435 次查看
Hi!
   Have you already checked the doc here? Or are you complaining about the approximation?

graziano
0 项奖励
2 条消息(共 5 条)
3,429 次查看

Thank you for the information.

I got to know the magic number 14 for Width.

But there still exist an over-estimating in height size.

Would you please comment if there are any other magic numbers?

0 项奖励
3 条消息(共 5 条)
3,426 次查看
I don't really know..... and since I don't have 难过表情 难过表情 难过表情 LV 8 I can't test it...... sorry!!!

graziano
0 项奖励
4 条消息(共 5 条)
3,423 次查看
I think the problem is with your string and the Match Pattern. Your input string sometimes has \r\n to indicate a new line, and sometimes \n. In your Match Pattern you're just searching for \n and passing the "before" string to the "Get Text Rect" VI. In the cases where you have a \r\n at the end, the "Get Text Rect" VI gets a string with \r at the end, which is displayed as a newline in a string, thus it will output a "bottom" of 26 instead of 13 (i.e., two lines), leading to extra space at the bottom since all you're doing is adding up the heights from each iteration.
0 项奖励
5 条消息(共 5 条)
3,398 次查看