我只是想向文本框或Winforms中的标签添加一些文本,然后将该文本另存为jpeg / bmp之类的图像。这可能吗?
Control类的DrawToBitmap方法将帮助您:
var bitmap = new Bitmap(this.textbox.Width, this.textbox.Height);
this.textbox.DrawToBitmap(bitmap, new Rectangle(0, 0, bitmap.Width, bitmap.Height));
请注意,您将拥有文本框的完整外观:边框,背景色等。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句