GraphicsPath::GetBounds()

Last post 10-31-2009 2:40 PM by SonicMouse. 3 replies.

Sort Posts:

  • GraphicsPath::GetBounds()

    10-29-2009, 11:08 PM
    • Member
      5 point Member
    • SonicMouse
    • Member since 03-29-2006, 10:32 AM
    • Posts 7

    Is there any way to set the bounds on a path?  I don't know if that's what I actually want to do, but it's the only thing i can think of.

    I am drawing letters separately... but when I Matrix::Scale() each letter to the size that I want, the letters get screwed up.

    This is what I end up with:


    But I want this:

    I am trying to avoid doing "DrawText("Don't");"

  • Re: GraphicsPath::GetBounds()

    10-30-2009, 6:29 AM
    Answer
    • Contributor
      2,944 point Contributor
    • imran_khan
    • Member since 03-11-2008, 11:57 AM
    • Ahmedabad
    • Posts 572

    Hey. visit my blog

    There are many examples to draw string. It may help you.

    Visit easyfastsigns.com. editor. I made this editor. there is another editor in this site.

    regard

    imrankhan


    Imrankhan
    -----------------------------------------------------
    Always remember to mark as answer on the post that helped you.

    My Blog :
    http://aspnet-solutions.blogspot.com/
    http://javascriptsolution.blogspot.com/
  • Re: GraphicsPath::GetBounds()

    10-31-2009, 2:20 PM
    • Member
      5 point Member
    • SonicMouse
    • Member since 03-29-2006, 10:32 AM
    • Posts 7

    Hi and thanks for your response...

    I am trying to avoid drawing the string all at once.  Basically, each glyph in the string is its own GraphicsPath.  So by the time it gets drawn, knowledge that it's a font isn't there.  I do it this way so i can add other GraphicsPaths that aren't derrived from fonts (like SVGs and the like)

    So, what i need to figure out is... All glyphs have a leading/trailing space (you can see it in the second "Don't" example)  When i call Matrix::Scale, the leading/trailing space is not preserved... How to i preserve this space?

  • Re: GraphicsPath::GetBounds()

    10-31-2009, 2:40 PM
    • Member
      5 point Member
    • SonicMouse
    • Member since 03-29-2006, 10:32 AM
    • Posts 7

    Here is a better example of what i wish to accomplish.  This is an SVG that i have rendered.  The grey dotted line around it is simply a call to GraphicsPath::GetBounds() and then the rectangle it returns is drawn.  As you can see, the space above his head, arms and bottom are preserved no matter how i call Matrix::Scale() on the GraphicsPath.


    This is what i want to accomplish on a Glyph.

Page 1 of 1 (4 items)