Vertical text in a graphic context.

Hi all,

I have the following code to display a text in vertical.

But I have a problem. The text is not displayed...

If I comment the line "e.Graphics.Transform = mx", the text is displayed.

Font drawFont = new Font("Arial", 16);

Matrix mx = new Matrix();

mx.Rotate(90f);

e.Graphics.Transform = mx;

e.Graphics.DrawString("toto", drawFont, Brushes.Black,

0, 0, new StringFormat());

e.Graphics.ResetTransform();

Thanks,

Yves Teissier



Answer this question

Vertical text in a graphic context.

  • Gaurav Singh

    Thanks,

    That's work.

    This code the way I use :

    aGraphics.TranslateTransform((float)(dX-dY), (float)(dX + dY));

    aGraphics.RotateTransform(-90);

    Yves.


  • Stayron

    Draw you text in the middle of the screen to test. If you draw at 0, 0 and rotate 90 degree your text should apprea in Y negative, X positive

  • Vertical text in a graphic context.