J'ai besoin de dessiner du texte VERTICALEMENT directement sur un Windows Mobile Form. Ceci est une application Compact Framework 2.0. J'ai le code de test suivant qui fonctionne dans une application de formulaire Windows, mais il ne fonctionne pas avec le cadre compact car il n'y a PAS de DirectionVertical StringFormatFlag. Existe-t-il une autre façon de faire la même chose sur Windows Mobile? La mise à niveau vers Compact Framework 3.5 n'a PAS aidé. Il a le même StringFormatFlags que 2.0.Comment dessiner du texte verticalement avec un cadre compact
private void TestDrawVertically()
{
Font myFont = new Font(FontFamily.GenericSerif, 10, FontStyle.Bold);
System.Drawing.Brush myBrush = new SolidBrush(Color.Black);
Rectangle myRect = new Rectangle(10, 10, 200, 200);
StringFormat myFormat = new StringFormat();
myFormat.LineAlignment = StringAlignment.Center;
myFormat.Alignment = StringAlignment.Center;
myFormat.FormatFlags = StringFormatFlags.DirectionVertical;
Graphics myGraphic = this.CreateGraphics();
myGraphic.DrawString("Hello", myFont, myBrush, myRect, myFormat);
}
Merci.
Quoi de graphique g à la méthode statique? –