"Gregory Khra" <GregoryKhra@discussions.microsoft.com> schrieb:
[quoted text, click to view] >I use Windows Forms and VS 2005 to draw a plot on the form. How can I save
> this plot to a graphics file (preferably jpg)? I couldn't find appropriate
> class in the Framework.
Simply use a 'Graphics' object based on an image to draw the plot (air
code):
\\\
Private Overrides Sub OnPaint(ByVal e As PaintEventArgs)
DrawPlot(e.Graphics)
End Sub
Private Sub SavePlot(ByVal FileName As String)
Using Image As New Bitmap(...)
Using g As Graphics = Graphics.FromImage(Image)
DrawPlot(g)
End Using
Image.Save(FileName)
End Using
End Sub
Private Sub DrawPlot(ByVal g As Graphics)
g.DrawLine(...)
' Drawing code.
End Sub
///
--
M S Herfried K. Wagner
M V P <URL:
http://dotnet.mvps.org/> V B <URL:
http://dotnet.mvps.org/dotnet/faqs/>