Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

WaveformGraph and Legend Printing

I recently had a request to combine a legend and a waveform graph into one image for printing.  I found a post on stackoverflow showing how to combine two images so I made a form up that allows you to make fairly decent images of the graph and legend.  Below is a screen shot of the form which has a few properties for sizes as well as to print with a white background.  I find the black backgrounds are nice for presentations but white is nicer for printing (and saving toner!).  The images can be saved to a file and / or the clipboard.

 

Export Dialog.png

 

This is what a graph with a white background looks like

White Background.png

 

And this is the typical black background or however you have configured you graph to look

 

Screen Background.png

 

The form is pretty easy to use.  You just pass the waveform graph and the legend to the constructor

 

ImageExport export = new ImageExport(waveformGraph1, legend1);
export.ShowDialog(this);

 

There is some issue with annotations that I haven't figured out yet.  If the size of the exported image is not the same as the graph on the form the annotation do not display in the correct position.......

 

 

 

 

 

Message 1 of 3
(6,160 Views)

That's very handy.  Thank you for sharing!

Jesse S.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 3
(6,140 Views)

The image export form is a piece of an open source data file viewer that I started recently.  It was originally designed to view just SDF files.  I'm slowly adding support for TDMS files as well.  If anyone is interested in working on the project let me know.  I've been working to add support for large data sets >1million points.  I created a min/max decimation algorithm that dynamically reloads data points based on the visible X axis range.  If there are > 1million points it plots every 1000th point, > 100k points every 100th point, etc.  The performance is fairly good and there is virtually no difference is the image that is displayed on the screen.  I found the Measurement Studio .NET graph controls didn't perform nearly as well as the old ActiveX controls.  The old controls could handle a million points without any issues.  Using this decimation algorithm the performance is actually better and the memory footprint is much smaller. 

 

The application also has some analysis features built in.  Currently this is limited to an audio player that converts a DAQ signal to an audio file for playback.  You can decrease the speed of playback as well which is handy for some NVH applications.  

 

Note this is a very early beta application and there are most likely many issues.  To open an SDF or TDMS file you need to select a directory in the Folder tab and then drag a file from the Files tab into the project tab.  Charting is done by dragging a channel onto the chart.  

 

MainWindow.png    

0 Kudos
Message 3 of 3
(6,085 Views)