C#畫(huà)筆Pen畫(huà)虛線的方法
本文實(shí)例講述了C#畫(huà)筆Pen畫(huà)虛線的方法。分享給大家供大家參考。具體實(shí)現(xiàn)方法如下:
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Drawing.Drawing2D; namespace WindowsApplication2 { public partial class Form11 : Form { public Form11() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { Pen pen2 = new Pen(Color.Blue, 12); pen2.DashStyle = DashStyle.Custom; pen2.DashPattern = new float[] { 1f, 1f }; Graphics g2 = this.CreateGraphics(); g2.DrawLine(pen2, 10, 150, 500, 150); } } }
希望本文所述對(duì)大家的C#程序設(shè)計(jì)有所幫助。
相關(guān)文章
C#導(dǎo)出GridView數(shù)據(jù)到Excel文件類實(shí)例
這篇文章主要介紹了C#導(dǎo)出GridView數(shù)據(jù)到Excel文件類,實(shí)例分析了C#使用GridView及Excel的技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下2015-03-03C#中使用Socket獲取網(wǎng)頁(yè)源代碼的代碼
C#使用Socket獲取網(wǎng)頁(yè)源代碼的代碼,需要的朋友可以參考下。2010-12-12關(guān)于Unity中RectTransform與transform的區(qū)別
這篇文章主要介紹了Unity中RectTransform與transform的區(qū)別,本文給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2022-01-01C#實(shí)現(xiàn)Log4Net日志分類和自動(dòng)維護(hù)實(shí)例
這篇文章主要介紹了C#實(shí)現(xiàn)Log4Net日志分類和自動(dòng)維護(hù),實(shí)例講述了Log4Net日志分類和自動(dòng)維護(hù)的實(shí)現(xiàn)方法,并提供了完整的實(shí)例供大家參考學(xué)習(xí),需要的朋友可以參考下2014-10-10Unity Shader實(shí)現(xiàn)2D水流效果
這篇文章主要為大家詳細(xì)介紹了Unity Shader實(shí)現(xiàn)2D水流效果,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2020-05-05C#調(diào)用Java類的實(shí)現(xiàn)方法
以下是對(duì)使用C#調(diào)用Java類的實(shí)現(xiàn)方法進(jìn)行了詳細(xì)的介紹,需要的朋友可以過(guò)來(lái)參考下2013-09-09C#中TextBox實(shí)現(xiàn)輸入提示功能的方法
這篇文章主要介紹了C#中TextBox實(shí)現(xiàn)輸入提示功能的方法,涉及C#中TextBox的相關(guān)操作技巧,需要的朋友可以參考下2015-06-06