LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Write text to graph

Smiley Very Happy
Hello, guys, I wrote a code to write text into the graph, however, I don't quite like the way it works (save image, read image into a picture, add text, save again). Do you have any suggestions ?
 
Any help will be appreciated!
 
Best
 
Camu
0 Kudos
Message 1 of 7
(5,527 Views)
Did you copy this code from someplace else? The VI is in 8.2.1 but it's calling "OldGetImage", implying it's from an older version of LabVIEW. Regardless, that's the hard way of doing it. The easy way:




Message Edited by smercurio_fc on 06-25-2008 01:19 PM
Message 2 of 7
(5,516 Views)

Robot Happy

I did find the code from somewhere else, probably from what you mentioned. Thanks for providing this easy way of writing text. However, what I want is to write the text just below the graph and then save the graph with text as jpg. I think your code may have a problem when writing text.

Best

Camu

0 Kudos
Message 3 of 7
(5,510 Views)
That's not what you initially said. You initially said you wanted to draw inside the graph. Smiley Wink

If you want to draw the text while the graph is displayed on the front panel and have it visible while the code is running you can place a transparent picture control over the graph and simply draw the text on this picture control. Doing this will prevent you from using the graph palette for zooming and using cursors since the picture control will receive the mouse clicks. When you want to export the combined image you just need to get the graph image and merge it with the picture control.

If, on the other hand, you just want to add the text when you save it, then you can do so by getting the graph image and drawing on it before you save:




Message Edited by smercurio_fc on 06-25-2008 01:48 PM
0 Kudos
Message 4 of 7
(5,501 Views)
Smiley Very Happy
Thanks a lot Smercurio. Smiley Happy Your code works fantastic in my application. Thanks a lot again.
 
Best
Camu
0 Kudos
Message 5 of 7
(5,481 Views)
Glad I could help. Smiley Very Happy

Note that you may need to tweak the GetImage Invoke node to get a better image quality. For instance, the Image Depth parameter defaults to 8 if left unwired (as in my example). This is 8-bit color, and is responsible for the "choppy" intensity bar in the picture. You probably want to set this to 24.
0 Kudos
Message 6 of 7
(5,478 Views)

Hi Smercurio,

 

I like your method of adding text to graph a lot. I'm very new to labview, especially picture functions as well as property node.

Could you post a .vi file so I could download? You can also send your example vi to ys2405@columbia.edu. Thanks a lot for your help!

 

Yunde Shi

 

 

0 Kudos
Message 7 of 7
(5,073 Views)