Converting FontUnit into float-value - ASP.NET - C#

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Brutus
    New Member
    • Feb 2008
    • 1

    Converting FontUnit into float-value - ASP.NET - C#

    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:
    Code:
    String sFontSize = context.Request.Params.Get("FontSize");
    FontUnitConverter fuc = new FontUnitConverter();
    FontUnit fu= FontUnit.Parse(sFontSize);
    - This doesn't work:
    Code:
    float nfu= (float)fuc.ConvertTo(fu, typeof(float));
    - Nor:
    Code:
    Single nfu = (Single) fuc.ConvertTo(fu, typeof(Single));
    - I need the float-value to create a Font:
    Code:
    Font newFont= new Font("Fontname", (float) FontSize);
    Does anyone have any ideas?

    Thanx, Brutus
    Last edited by jhardman; Feb 19 '08, 07:22 PM. Reason: moved to .Net forum. ASP forum is for "classic" ASP
  • idsanjeev
    New Member
    • Oct 2007
    • 241

    #2
    Hi Brutus
    your question about .net posted in asp forum
    so please post it to .net forum
    some body help you on .net
    thanks
    Regards
    sanjeev

    Comment

    Working...