System.Drawing For Drawing Text Images

Discussion in 'ASP .Net' started by jjbutera@hotmail.com, Jan 9, 2006.

  1. Guest

    There are a lot of examples out there, but I was hoping something could
    help me further. I'd like to draw text (unknown length) to an image,
    but then crop the image to the height and width of the text. Is this
    possible?

    I'm guessing I can get the height from the Font.Height property. But
    how do I go about getting the width of the drawn text?

    Also, are there any tip for drawing fairly smooth fonts?

    Thanks,

    Jason
     
    , Jan 9, 2006
    #1
    1. Advertising

  2. Check out the Graphics.MeasureString() method for measuring your text.
    And for smoothing, check out the Graphics.SmoothingMode property.

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    You can lead a fish to a bicycle,
    but it takes a very long time,
    and the bicycle has to *want* to change.

    <> wrote in message
    news:...
    > There are a lot of examples out there, but I was hoping something could
    > help me further. I'd like to draw text (unknown length) to an image,
    > but then crop the image to the height and width of the text. Is this
    > possible?
    >
    > I'm guessing I can get the height from the Font.Height property. But
    > how do I go about getting the width of the drawn text?
    >
    > Also, are there any tip for drawing fairly smooth fonts?
    >
    > Thanks,
    >
    > Jason
    >
     
    Kevin Spencer, Jan 9, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. eruess
    Replies:
    0
    Views:
    479
    eruess
    Aug 8, 2003
  2. byrd48
    Replies:
    0
    Views:
    3,602
    byrd48
    Jul 6, 2006
  3. Eugenio

    Low Quality text in System.Drawing

    Eugenio, Jun 20, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    392
    =?Utf-8?B?TWlsb3N6IFNrYWxlY2tpIFtNQ0FEXQ==?=
    Jun 21, 2007
  4. Scott Elgram

    System.Drawing & Tiff images

    Scott Elgram, Aug 13, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    405
    Scott Elgram
    Aug 16, 2007
  5. defn noob
    Replies:
    1
    Views:
    429
    Mark Space
    Jun 28, 2008
Loading...

Share This Page