Click here to Skip to main content
15,793,139 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have one windows form with a button.when i click the button a graph is to be displayed.

A separate class has been created for creating a graph..with all member functions.

i call this class through the form.when button is triggered...the graph class is supposed to
final image is created..i can make out using breakpoints..

but i am unable to display the image...

line2d is the calss...line2d.getgraph is the function gor getting a graph.
how will i get it in form using memory stream..

an example from codeproject froums is give ..plz refer to LineChart application.but user used webforms for displaying final image...the last 2 lines of the apllication are given below.
Bitmap bmp = line2d.GetGraph();
Updated 10-Feb-13 22:27pm
Sergey Alexandrovich Kryukov 11-Feb-13 1:49am    
Not clear. Could you use "Improve question" above?
Guirec 11-Feb-13 5:55am    
simply replace 'Response.OutputStream' by a variable you will declare as new MemoryStream();
then you can uset the newly created stream to save the file to disk and render it in a windows form.

1 solution

The Bitmap.Save method accepts the stream object or file path to which the bitmap is to be saved.
In your last line of code replace 'Response.OutputSream' to MemoryStream object if you want to save in memory file or pass the temporary file path where you can save the image.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900