Ich benutze C#, um einen Text in einem bestimmten Format zu schreiben. Mein Problem ist, dass sich beim Ändern der Schriftgröße sowohl die Breite als auch die Höhe ändern, während ich nur die Schrifthöhe ändern möchte.Wie kann ich die Schrifthöhe in system.drawings.font einstellen?
Mein Code:
using (Graphics graphics = Graphics.FromImage(bitmap))
{
using (System.Drawing.Font romanfont = new System.Drawing.Font("Times New Roman",11, FontStyle.Bold))
//using (System.Drawing.Font romanfont = new System.Drawing.Font("Times New Roman", 11, FontStyle.Bold))
{
SolidBrush transBrush = new SolidBrush(Color.FromArgb(65, 79, 79));
StringFormat format = new StringFormat(StringFormatFlags.DirectionRightToLeft);
graphics.DrawString(firstname, romanfont, transBrush, firstnameLocation, format);
graphics.DrawString(secondname, romanfont, transBrush, secondnameLocation, format);
graphics.DrawString(finalfirstadd, romanfont, transBrush, firstaddresslocation, format);
graphics.DrawString(finalsecondadd, romanfont, transBrush, secondaddresslocation, format);
}
}
gibt es keine andere Lösung – Lupindo