Click here to Skip to main content
13,049,263 members (62,791 online)
Rate this:
Please Sign up or sign in to 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();
Posted 10-Feb-13 19:37pm
Updated 10-Feb-13 21:27pm
Not clear. Could you use "Improve question" above?
Guirec Le Bars 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

Rate this: bad
Please Sign up or sign in to vote.

Solution 2

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.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170713.1 | Last Updated 11 Feb 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100