close
MSDN官方網頁並沒有標記5,2,15,4
乍看之下, 一頭霧水後來在另一個討論主題看到其他人解釋才豁然開朗
畫虛線
float[] dashValues = { 2, 2 };
畫點線
float[] dashValues = { 1, 1 };
畫點虛線
float[] dashValues = { 1, 2, 2, 1 };
變更字的顏色 system.Drawing.Brush
Brush brush = new System.Drawing.SolidBrush(Color);
如何寫垂直的字
private void DrawVerticalText()
{
System.Drawing.Graphics formGraphics = this.CreateGraphics();
string drawString = "Sample Text";
System.Drawing.Font drawFont = new System.Drawing.Font("Arial", 16);
System.Drawing.SolidBrush drawBrush = new System.Drawing.SolidBrush(System.Drawing.Color.Black);
float x = 150.0f;
float y = 50.0f;
System.Drawing.StringFormat drawFormat = new System.Drawing.StringFormat(StringFormatFlags.DirectionVertical);
formGraphics.DrawString(drawString, drawFont, drawBrush, x, y, drawFormat);
drawFont.Dispose();
drawBrush.Dispose();
formGraphics.Dispose();
}
參考資料
參考資料
1. How to: Draw a Custom Dashed Line
全站熱搜
留言列表