Crainiate Community

Support and discussion for users of Crainiate component software products
Welcome to Crainiate Community Sign in | Join | Help
in Search

Rotation TextLabel

Last post 03-17-2008 12:00 PM by Mario. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 01-07-2008 11:19 AM

    • Mario
    • Top 50 Contributor
    • Joined on 01-07-2008
    • Posts 2

    Rotation TextLabel

    Hi,

    how i can modify the rotation of a textlabel marker, to fix the position of the textlabel  always in orizontal.

    thanks

    Mario

    Filed under:
    • 217.59.118.74
  • 01-13-2008 10:16 PM In reply to

    Re: Rotation TextLabel

    You need to manually draw the Label by subclassing the Line class you are using and override the Render method.

    Call base.Render then either draw text directly using the graphics object, or call Label.Render.

    • 86.140.72.160
  • 03-17-2008 12:00 PM In reply to

    • Mario
    • Top 50 Contributor
    • Joined on 01-07-2008
    • Posts 2

    Re: Rotation TextLabel

     

     Now label is always orizontal but the position is not correct, I can not calculate marker position.

    class MyLine:Connector

    {

    public MyLine(PointF start, PointF end):base(start,end)

    {

     

    }

    protected override void Render(System.Drawing.Graphics graphics, IRender render)

    {

     

    base.Render(graphics, render);

    Label Label = new Label();

    Font f = Label.Font;Brush brush = new System.Drawing.SolidBrush(System.Drawing.Color.Black);

     

    graphics.DrawString(
    "Test", f, brush, render.RenderRectangle);

    }

    }

    Filed under:
    • 217.59.118.74
Page 1 of 1 (3 items)