monu_khan wrote:
TextBox1.Text.Length
This is more than a little insane. You need to use MeasureString to get a width and height.
monu_khan wrote:
Graphics g = Graphics.FromImage(b);
Why not use a using statement, instead of leaking resources ?
monu_khan wrote:
new Font("Kruti Dev 010", 12, FontStyle.Regular)
Another leak, plus if you change the font, it means you need to measure the string for that font. Although you're using ASP.NET, this question has nothing to do with ASP.NET, it's about some basic graphics work. Why do you waste server space by saving a string a a bitmap instead of as text ?
monu_khan wrote:
int alignment = 1; if (alignment == 1)
Bizarre.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.