ni.com is currently undergoing scheduled maintenance.
Some services may be unavailable at this time. Please contact us for help or try again later.
07-15-2005 10:08 AM
07-15-2005 10:31 AM
If you have Measurement Studio 7.1, you can do this via the ToFile method. For example:
' Export to a .gif file graph.ToFile("C:\Graph.gif", ImageType.Gif) ' Export to a .jpg file graph.ToFile("C:\Graph.jpg", ImageType.Jpeg)
- Elton
07-15-2005 10:48 AM
07-16-2005 06:19 PM
Sorry, I assumed you were using the Measurement Studio .NET Windows Forms graph since this was posted to the .NET forum. If you're using the interop wrappers to the Measurement Studio ActiveX UI controls, you can call ControlImage to get an image (metafile) of the graph, then you can save the image to a file via the Image.Save method by specifying a file name and either ImageFormat.Gif or ImageFormat.Jpeg. For example:
Dim controlImage As Image = Nothing Try controlImage = AxCWGraph1.ControlImage() ' Export to a .gif file controlImage.Save("C:\Graph.gif", System.Drawing.Imaging.ImageFormat.Gif) ' Export to a .jpg file controlImage.Save("C:\Graph.jpg", System.Drawing.Imaging.ImageFormat.Jpeg) Finally If Not controlImage Is Nothing Then controlImage.Dispose() End If End Try
Just out of curiosity, why are you using the interop wrapper to the Measurement Studio ActiveX UI controls rather than using the native Measurement Studio .NET Windows Forms controls?
- Elton