C# 對齊繪製的文字 [DrawString+StringAlignment.Center]
C# 對齊繪製的文字 [DrawString+StringAlignment.Center]
資料來源: https://docs.microsoft.com/zh-tw/dotnet/framework/winforms/advanced/how-to-align-drawn-text
string text1 = “Use StringFormat and Rectangle objects to” + ” center text in a rectangle.”; using (Font font1 = new Font(“Arial”, 12, FontStyle.Bold, GraphicsUnit.Point)) { Rectangle rect1 = new Rectangle(10, 10, 130, 140); // Create a StringFormat object with the each line of text, and the block // Draw the text and the surrounding rectangle. |