windows图像表单应用程序 [英] windows image forms application

查看:89
本文介绍了windows图像表单应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有按钮的窗体。当我点击按钮时,将显示一个图形。



已创建一个单独的类来创建图形..具有所有成员函数。



i通过表单调用此类。当触发按钮时...图表类应该运行。现在...

最终图像被创建..我可以使用断点来实现..



但我无法显示图像...



line2d是calss ... line2d.getgraph是获取图形的函数。

我将如何使用内存流获取它..


来自codeproject froums的例子是给..plz引用LineChart应用程序。但是用户使用webforms来显示最终图像...最后2行的apllication如下:

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.

Bitmap bmp = line2d.GetGraph();
bmp.Save(Response.OutputStream,ImageFormat.Jpeg);

推荐答案

Bitmap.Save方法接受流对象或者要保存位图的文件路径

在最后一行代码中,如果要保存,请将Response.OutputSream替换为MemoryStream对象内存文件或传递临时文件路径,您可以在其中保存图像。
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.


这篇关于windows图像表单应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆