将表单图像保存为文件 [英] Saving a form image a file
问题描述
我不敢相信在网络上保存表格(图像)到文件很少.我不在乎;可以使用哪种文件格式...我只想保存该织补表格!
VB6.0不适应表单保存吗???似乎很基础.
任何帮助将不胜感激.
哦....为澄清起见...我有一个表单(销售报价),该表单从另一表单的文本框中提取数据.非常非常基本的形式.表单上包含一个徽标/图像.
I can''t believe how little there is on the web about saving a form (image) to a file. I don;t care WHAT file format is available...I just wanna save the darn form!!
Does VB6.0 not accomodate a form save??? Seems so basic.
Any help would be appreciated.
Oh....just for clarification...I have a form (a sales quotation) that pulls data from text boxes from another form. Very very basic form. Has ONE logo/image included on the form.
推荐答案
好吧,我认为这样可以做到:
Well, I think this will do :
<br />
Bitmap MyBitmap = new Bitmap(this.Width, this.Height); <br />
this.DrawToBitmap(MyBitmap, new Rectangle(0,0,this.Width,this.Height)); MyBitmap.Save(@"c:\Test.bmp", ImageFormat.Bmp); <br />
并且您可以通过更改最后一行中的ImageFormat来使用任何格式来保存它.
-----------------
问候
H.Maadani
and you can use any format to save it by changing ImageFormat in the last line.
-----------------
Regards
H.Maadani
然后您将其放在Command_click()语句中?
And you would put that in a Command_click() statement??
当然!
我注意到您想要VB.NET中的解决方案,我上面编写的代码在C#中.您需要将一些代码更改为VB(请将此更改为Me).我对VB不那么熟悉,所以我不能自己写.但这并不复杂.
-------------
问候
H.Maadani
Of course!
I noticed that you wanted solution in VB.NET , the code I''ve written above is in C#. you''ll need to change some codes to VB (lik this to Me). I''m not that familliar with VB so I cant write it myself. but it is not that complicated.
-------------
Regards
H.Maadani
这篇关于将表单图像保存为文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!