ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

saving graph as image?

Solved!
Go to solution
Is there a way to save xy scatterGraph in .net as image file such as tiff? Thanks in advanced.
0 Kudos
Message 1 of 4
(4,643 Views)
Solution
Accepted by topic author Shazaduh

Hello - 

 

You could do something like this:

 

using (Bitmap bmp = new Bitmap(scatterGraph.Width, scatterGraph.Height))
{
    scatterGraph.DrawToBitmap(bmp, new Rectangle(0, 0, bmp.Width, bmp.Height));
    bmp.Save("GraphImage.tiff", ImageFormat.Tiff);
}

 

NickB

National Instruments 

0 Kudos
Message 2 of 4
(4,633 Views)

I forgot about an even easier way... Tiff is not supported, but gif, png, bmp, and jpeg are.

 

scatterGraph.ToFile("GraphImage.png", ImageType.Png);

 

NickB

National Instruments 

0 Kudos
Message 3 of 4
(4,627 Views)

Thank you nick!

0 Kudos
Message 4 of 4
(4,392 Views)