如何在c#winforms中生成位图框架? [英] How to generate a bitmap frames in c# winforms?
本文介绍了如何在c#winforms中生成位图框架?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨
我有文本框,按钮和图片框,我在文本框中键入内容,如果单击按钮,必须为该文本生成位图,它将出现在图片框中.
谢谢与问候
Sairam Bhat
Hi
I have text box, button and picture box,i am typing something in text box and if i click the button bitmap must be generate for that text and it will be appear in the picture box.
Thanks & Regards
Sairam Bhat
推荐答案
尝试:
Bitmap b = new Bitmap(100, 100);
using (Graphics g = Graphics.FromImage(b))
{
g.DrawString(myTextBox.Text, new Font("Times New Roman", 10.0F), Brushes.Black, new PointF(0, 0));
}
myPictureBox.Image = b;
这篇关于如何在c#winforms中生成位图框架?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文