LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

saving a .jpg file

hii all

i want to save the image in intensity graph to the disk with .jpg extension.

 

i have an array of data(eg. {21,2},{332,97972}so on..) and i actually want to get the .jpg of that data.

one way i can do is to save the intensity graph with .jpg..

but i do not know how to do that..

 

please help me..

thanks

do not hesitate to give kudosSmiley Happy
0 Kudos
Message 1 of 23
(5,552 Views)

Hi sahil,

 

if it's ok to get the full graph you could invoke the method "Get image" for this graph using it's reference. Wire the resulting "image data" to a "Write JPG" function...

SaveJPG.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 23
(5,548 Views)
Hi Sahil,

Do you have some code already? If you have your data in array format. Then you can use the "write jpeg file" vi which is located in the Graphics & Sounds palette.

To use this vi, you need to convert the array into a format this vi can understand. To do this, you can use the "Flatten pixmap" vi to convert your 2D array into the format the write vi needs.

Does this make some sense? 

Another method(however less effecient) is to use a "Get image" invoke node from your intensity graph. This gives an output of the image data, and therefore can be passed to the "write jpeg file" 

Let us know how you get on!
Ashish Naik
Automotive Business Development Manager
National Instruments UK
0 Kudos
Message 3 of 23
(5,546 Views)
Ah!

GerdW posted as I was writing my response! :smileyhappy:
 
GerdW's code is a perfect example of what I was mentioning in the second method!
Ashish Naik
Automotive Business Development Manager
National Instruments UK
0 Kudos
Message 4 of 23
(5,542 Views)

thanks    

 

 

and using another method same type of problem ocurs..

ie usingg flattening method i need to append to the .jpg file and i dont know how to append that..

the problem using pixmap is that it saves the .jpg file only for one time while my data is coming continuously..

i have already used the way you  told that by flattening pixmap method..

 

 

 

 

hii AshishN 

thanks

do not hesitate to give kudosSmiley Happy
0 Kudos
Message 5 of 23
(5,513 Views)

 oh sorry...i dont know this has happened ..please read bottom to up...

thanks

do not hesitate to give kudosSmiley Happy
0 Kudos
Message 6 of 23
(5,512 Views)
It was quite interesting reading bottom up 🙂

Do you have any code at the moment, about the way you are building the array? Are you wanting to save multiple jpeg files at different snapshots in time, or just one with the final array?

If the data is coming continuously, and you want all this data plotted on one, then use GerdW's method, but using a Chart rather than a Graph?
Ashish Naik
Automotive Business Development Manager
National Instruments UK
0 Kudos
Message 7 of 23
(5,510 Views)

hii 

 

i am not able to get the .jpg file of the continuous data..but it shows only the last data being there on the intensity chart...but i want the .jpg of the whole intensity chart..so now what should i do??please help....

 

 

thanks

do not hesitate to give kudosSmiley Happy
0 Kudos
Message 8 of 23
(5,477 Views)
I don't understand. Isn't the intensity chart with the last data the whole intensity chart?
0 Kudos
Message 9 of 23
(5,473 Views)

Hi sahil,

 

what do you mean by "the .jpg of the whole intensity chart"?

 

Isn't the whole chart shown in the jpg? Do you want data, that isn't actually shown on screen, included in the picture? Don't you set autoscale accordingly?

 

The method shown above will save the current state of the indicator into a jpg - nothing more and nothing less Smiley Wink

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 23
(5,472 Views)