close

MSDN官方網頁並沒有標記5,2,15,4

乍看之下, 一頭霧水後來在另一個討論主題看到其他人解釋才豁然開朗

image

畫虛線

float[] dashValues = { 2, 2 };

image

畫點線

float[] dashValues = { 1, 1 };

image

畫點虛線

float[] dashValues = { 1, 2, 2, 1 };

image


變更字的顏色 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

2. How to draw an image with PictureBoxSizeMode.Zoom

3.convert from Color to brush

4.Code: Drawing Vertical Text on a Form (Visual C#)

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 me1237guy 的頭像
    me1237guy

    天天向上

    me1237guy 發表在 痞客邦 留言(0) 人氣()