C#模式畫刷HatchBrush用法實例
更新時間:2015年06月11日 15:05:47 作者:zhuzhao
這篇文章主要介紹了C#模式畫刷HatchBrush用法,實例分析了模式畫刷HatchBrush繪圖的相關(guān)技巧,需要的朋友可以參考下
本文實例講述了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)
{
}
}
}
希望本文所述對大家的C#程序設(shè)計有所幫助。
相關(guān)文章
使用C#實現(xiàn)將CSV文件內(nèi)容裝配成對象列表
這篇文章主要為大家詳細(xì)介紹了如何使用C#實現(xiàn)將CSV文件內(nèi)容裝配成對象列表,文中的示例代碼講解詳細(xì),感興趣的小伙伴可以跟隨小編一起學(xué)習(xí)一下2023-12-12
C# TextBox多行文本框的字?jǐn)?shù)限制問題
最近在使用C# TextBox多行文本框的時候,發(fā)現(xiàn)了其對字?jǐn)?shù)限制的一點問題,所以總結(jié)下在使用C# TextBox多行文本框要注意的的字?jǐn)?shù)限制問題,現(xiàn)在分享給大家,有需要的朋友們可以參考借鑒,下面來一起看看吧。2016-12-12
C#短時間內(nèi)產(chǎn)生大量不重復(fù)的隨機(jī)數(shù)
在C#編程中,經(jīng)常會碰到產(chǎn)生隨機(jī)數(shù)的情況,并且是在短時間內(nèi)產(chǎn)生一組隨機(jī)數(shù)。如果這組隨機(jī)數(shù)中有大量重復(fù)的,則達(dá)不到我們的要求2013-02-02

