Click here to Skip to main content
15,886,788 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 run.now...
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.
C#
Bitmap bmp = line2d.GetGraph();
bmp.Save(Response.OutputStream,ImageFormat.Jpeg);
Posted
Updated 10-Feb-13 21:27pm
v3
Comments
Sergey Alexandrovich Kryukov 11-Feb-13 1:49am    
Not clear. Could you use "Improve question" above?
—SA
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