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,512 Views)
Solution
Accepted by 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,502 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,496 Views)

Thank you nick!

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