Click here to Skip to main content
15,884,629 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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
Posted
Updated 14-Mar-11 12:38pm
v2
Comments
Toli Cuturicu 14-Mar-11 18:38pm    
What is that number (948...) supposed to mean? I deleted it anyway for being irrelevant.

1 solution

Try:
C#
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;
 
Share this answer
 
Comments
sairam.bhat 14-Mar-11 8:33am    
k thanks
sir
sairam.bhat 14-Mar-11 9:11am    
sir this will not create image sir
OriginalGriff 14-Mar-11 9:38am    
Yes it does - I tried it. What is it doing / not doing that seems to be a problem?

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900