Sharon_ Posted July 10, 2015 Report Share Posted July 10, 2015 Hi friends, In my VI, there is a the text control with texts with different color( Basicall for OCR application , to show incorrect charcters). But if I run the VI attached(Purpose of the VI is to add some symbols at specific location) with this post all text color reset to default. I am pretty sure I am making with the usage of Text Ref. I tried with 2 approaches- 1. with text control ref 2. with only the text. But not working. Any idea? BTW the text control is for unicode characters. Sub_Add_Symbol_to_OCR_String.vi -Sharon. Quote Link to comment
Sharon_ Posted July 10, 2015 Author Report Share Posted July 10, 2015 HI, I am doing something like below. It works.. but I am not sure , it is the best solution. I am 'copying' the color info of the text before I execute the VI. Regards, Sharon Quote Link to comment
ensegre Posted July 10, 2015 Report Share Posted July 10, 2015 To my understanding, String values consist only of the characters of the string, and either getting them as referenced control value or as indicator content, they won't include formatting any better than they would include any other property of the indicator they came from. I think you'll have to pass the coloring information along by some other means, such as index arrays containing the start and end positions of your coloring. Or, augmenting your string with "control characters" acting as escape sequences determining the colors. As such, they will need to be parsed and filtered out down the line. Quote Link to comment
ShaunR Posted July 10, 2015 Report Share Posted July 10, 2015 I am 'copying' the color info of the text before I execute the VI. Are you sure? From you image, it looks to me that the first text selection node can operate before, during or after the "add symbol" sub VI as LabVIEW decides. Quote Link to comment
Sharon_ Posted July 13, 2015 Author Report Share Posted July 13, 2015 (edited) Are you sure? From you image, it looks to me that the first text selection node can operate before, during or after the "add symbol" sub VI as LabVIEW decides. Hi Shaun, I am not sure I understood your question. So I have added one more pivture with the post. My software processes the string line-by-line.So somehow I need to retain the color property of the texts. Forgot to mention->The Selection before Step2.1 copies the color property of 'Dial S for' string. Regards, Sharon Edited July 14, 2015 by Sharon_ Quote Link to comment
Sharon_ Posted July 14, 2015 Author Report Share Posted July 14, 2015 My approach is incorrect for lines more than 2. ​ Because the copying works only with the previous (line) value. So what I have done is that I created a color cluster - capturing all index with color values and finally changed colors of the texts. Thanks, Sharon Quote Link to comment
ShaunR Posted July 14, 2015 Report Share Posted July 14, 2015 (edited) My approach is incorrect for lines more than 2. ​ Because the copying works only with the previous (line) value. So what I have done is that I created a color cluster - capturing all index with color values and finally changed colors of the texts. Thanks, Sharon Are you sure it's not a sequencing issue? ...... ..... because you need. Edited July 14, 2015 by ShaunR Quote Link to comment
Sharon_ Posted July 15, 2015 Author Report Share Posted July 15, 2015 Shaun, That's right. The string input to the VI is actually the value of the Str ref. But the problem here is that, Text.SelStart/Text.Sel.End holds only one value, not the whole text color index values. So I could not use it, as shown in the picture. Thanks, Sharon Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.