Jump to content

Text control- text color gets reset after char append.


Recommended Posts

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. :lightbulb:

I tried with 2 approaches- 1. with text control ref

                                          2. with only the text.

 

But not working. :oops:

Any idea? :rolleyes:

BTW the text control is for unicode characters.

 

 Sub_Add_Symbol_to_OCR_String.vi

 

-Sharon.

Link to comment

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.

Link to comment

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.

 

post-16569-0-99591400-1436749236.jpg

 

Forgot to mention->The Selection before Step2.1 copies the color property of 'Dial S for' string.

 

Regards,

Sharon

Edited by Sharon_
Link to comment

My approach is incorrect for lines more than 2. :oops:​  Because the copying works only with the previous (line) value. :ph34r: 

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. :thumbup1:

 

 

Thanks,

Sharon

Link to comment

My approach is incorrect for lines more than 2. :oops:​  Because the copying works only with the previous (line) value. :ph34r:

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. :thumbup1:

 

 

Thanks,

Sharon

 

Are you sure it's not a sequencing issue? ......

 

post-15232-0-16036000-1436874874.png

 

..... because you need.

 

post-15232-0-60493900-1436874935.png

Edited by ShaunR
Link to comment

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

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.