C#模式畫刷HatchBrush用法實(shí)例
更新時(shí)間:2015年06月11日 15:05:47 作者:zhuzhao
這篇文章主要介紹了C#模式畫刷HatchBrush用法,實(shí)例分析了模式畫刷HatchBrush繪圖的相關(guān)技巧,需要的朋友可以參考下
本文實(shí)例講述了C#模式畫刷HatchBrush用法。分享給大家供大家參考。具體如下:
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 Form7 : Form { public Form7() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { try { HatchBrush hat = new HatchBrush(HatchStyle.Divot, Color.DarkBlue, Color.White); Graphics formGraphics = this.CreateGraphics(); formGraphics.FillRectangle(hat, new RectangleF(90.0F, 110.0F, 100, 100)); formGraphics.Dispose(); } catch (System.IO.FileNotFoundException) { MessageBox.Show("There was an error opening the bitmap." + "Please check the path."); } } private void Form7_Load(object sender, EventArgs e) { } } }
希望本文所述對(duì)大家的C#程序設(shè)計(jì)有所幫助。
相關(guān)文章
C#中使用CAS實(shí)現(xiàn)無(wú)鎖算法的示例詳解
CAS(Compare-and-Swap)是一種多線程并發(fā)編程中常用的原子操作,用于實(shí)現(xiàn)多線程間的同步和互斥訪問。本文將利用CAS實(shí)現(xiàn)無(wú)鎖算法,需要的可以參考一下2023-04-04C#如何讀寫應(yīng)用程序配置文件App.exe.config,并在界面上顯示
這篇文章主要介紹了C#如何讀寫應(yīng)用程序配置文件App.exe.config,并在界面上顯示問題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2023-06-06c# 判斷是否為空然后賦值的4種實(shí)現(xiàn)方法
下面小編就為大家分享一篇c# 判斷是否為空然后賦值的4種實(shí)現(xiàn)方法,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來看看吧2017-12-12HTML文本框的值改變后觸發(fā)后臺(tái)代碼的方法
asp.net用日期插件,當(dāng)選中一個(gè)日期時(shí)觸發(fā)一個(gè)事件,以查詢當(dāng)前日期的數(shù)據(jù)。這是要跟數(shù)據(jù)庫(kù)交互的。先貼出控件代碼:2013-04-04Unity?AssetPostprocessor模型函數(shù)Model實(shí)用案例深入解析
這篇文章主要為大家介紹了Unity?AssetPostprocessor模型Model函數(shù)實(shí)用案例深入解析,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2023-05-05