I'm a total newbie in C# and ASP.NET, so I hope I'm in the right forum. My very first project is a custom control that converts strings into images on the fly (through a httphandler) - that works fine, except for 'FontSize'. I have no clue how to convert the FontUnit into a float-value.
- This works fine:
- This doesn't work:
- Nor:
- I need the float-value to create a Font:
Does anyone have any ideas?
Thanx, Brutus
- This works fine:
Code:
String sFontSize = context.Request.Params.Get("FontSize");
FontUnitConverter fuc = new FontUnitConverter();
FontUnit fu= FontUnit.Parse(sFontSize);
Code:
float nfu= (float)fuc.ConvertTo(fu, typeof(float));
Code:
Single nfu = (Single) fuc.ConvertTo(fu, typeof(Single));
Code:
Font newFont= new Font("Fontname", (float) FontSize);
Thanx, Brutus
Comment